(re-)Building the ArcGIS Geoportal Extension

The ArcGIS Geoportal Extension (GPE) comes as a bunch of web applications, packaged as .war files, executables and scripts. Depending on your requirements you will want to install and/or use a subset of these. Also you will want to customize the look and feel of the portal website.To do any customization requires extracting and/or modifying deployed files or repackaging the web apps; this can be done by tedious and error prone handwork or you can set up an automated build system using Maven.
Using Maven we can use a technique called “war overlays” where we tell maven to construct a war file from a number of sources, including the original distribution .war file.
In our (version controlled) source tree we keep only the files that we want modified, the original .war file and some extra’s that we need in the portal, so we end up in a situation where we have a sparsely filled source tree with a dependency on the originally distributed .war file.

GPE directory layout

Inside our Maven project file this looks as follows, declaring the dependency on the ESRI .war file using system scope, shown below.

<dependencies>
	<dependency>
		<groupId>com.esri</groupId>
		<artifactId>geoportal
		<version>9.3.1.400</version>
		<type>war</type>
		<scope>system</scope>
		<systemPath>${basedir}/src/distro/geoportal.war</systemPath>
	</dependency>
</dependencies>

During the build phase we make the war overlay using the following snippet:

<build>
	<finalName>geoportal</finalName>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-war-plugin</artifactId>
			<version>2.1-beta-1</version>
			<configuration>
				<overlays>
					<!-- sequence is important -->
					<overlay>
						<!-- empty groupId/artifactId is detected as the current build -->
					</overlay>
					<overlay>
						<groupId>com.esri</groupId>
						<artifactId>geoportal</artifactId>
					</overlay>
				</overlays>
				<archive>
					<index>true</index>
					<manifestEntries>
						<Specification-Vendor>ESRI</Specification-Vendor>
						<Specification-Title>ESRI GIS Portal ToolKit</Specification-Title>
						<Specification-Version>9.0</Specification-Version>
						<Implementation-Title>ESRI GIS Portal ToolKit uitgebreid door LNV-GCC</Implementation-Title>
						<Implementation-Version>9.3.1.400</Implementation-Version>
						<Implementation-Vendor>ESRI / min. LNV</Implementation-Vendor>
						<SCM-Revision>${scm.revision}</SCM-Revision>
						<versie>${project.version}</versie>
						<url>${project.url}</url>
						<build>${buildNumber}</build>
					</manifestEntries>
				</archive>
			</configuration>
		</plugin>
	</plugins>
</build>

Using the command

mvn install

will give us the georportal.war file with the correct configuration for our development environment as part of the build, so it can be pushed to a Tomcat server using the tomcat-maven-plugin.

<build>
	<plugins>
		<plugin>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>tomcat-maven-plugin</artifactId>
			<version>1.0-beta-1</version>
			<configuration>
				<url>http://dbrXXXXv/manager</url>
				<server>dbrXXXXv</server>
			</configuration>
		</plugin>
	</plugins>
</build>

This snippet is inside a profile that is activated on the build server resulting in the newest version to be up-and-running within ten or fifteen minutes after the code has been checked into source control.

Advertisements

Join 58 other followers

GISpunt logo

tweets


%d bloggers like this: