Starting with ArcGIS Enterprise SDK 10.8.1, Java server object extensions (SOEs) and server object interceptors (SOIs) use Apache Maven for project creation, dependency management, and builds. The SDK provides Maven dependencies, build plugins, and project archetypes, as well as a tool for installing the SDK artifacts into a local Maven repository.

This topic describes the Maven artifacts supplied with ArcGIS Enterprise SDK and explains how to create, manage, and build Java SOE and SOI projects.

ArcGIS Enterprise SDK Maven artifacts

The SDK includes Maven artifacts for Java custom extension development and other supported Java extensibility workflows. To install these artifacts in your local Maven repository, run the install-maven-artifacts tool supplied with the SDK. The default Maven local repository is located at:

  • Windows: C:\Users\<username>\.m2\repository

  • Linux: /home/<username>/.m2/repository

The SDK installation tool documents the following artifacts:

Maven artifactPurpose
arcgis-enterprise-sdk-parentParent POM containing shared Maven configuration for SDK projects.
arcgis-enterprise-sdkJava SDK API dependency used by SOEs and SOIs.
sdk-pluginMaven plugin for packaging SOEs and SOIs and generating WSDL files for SOAP SOEs.
rest-soe-archetypeProject template for REST SOEs.
soap-soe-archetypeProject template for SOAP SOEs.
rest-soap-soe-archetypeProject template for SOEs that expose both REST and SOAP operations.
soi-archetypeProject template for SOIs.
arcgis-pbfLibrary for encoding and decoding Protocol Buffer Format (PBF) data.
enterprise-interceptorSDK dependency used for Java service interceptor development.
interceptor-sdk-pluginMaven plugin used for service interceptor projects.
server-service-interceptor-archetypeProject template for service interceptors.

The SOE and SOI examples in this topic use arcgis-enterprise-sdk, sdk-plugin, and the SOE/SOI archetypes. Service interceptors follow a different development workflow and use their own Maven artifacts. For more information, see the Service interceptors guide.

The ArcGIS Enterprise SDK JAR (arcgis-enterprise-sdk.jar) and Maven plugin (sdk-plugin.jar) will be used by the SOE or SOI project at the generate-resources and package Maven lifecycle phases, to generate the .wsdl file and package the SOE or SOI. They are referenced at the project's POM (pom.xml file). The POM is an XML representation of the Maven project, containing project configuration information such as the project's dependencies, the Java compiler used, the developers involved, the URL of where the project lives, and so on. To learn more about POM, refer to the Maven POM Reference page.

ArcGIS Enterprise SDK dependency

The arcgis-enterprise-sdk artifact provides the Java classes and interfaces used to develop SOEs and SOIs. The SDK archetypes automatically add this dependency to a project's pom.xml file. When an SOE or SOI project is created from the archetype, this dependency will be added automatically under the project's dependencies in the pom.xml file (see POM dependencies).

The following example illustrates a dependency for an ArcGIS Enterprise SDK 12.2 project:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.mycompany.soe</groupId>
<artifactId>mysoe</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>com.esri.arcgis.enterprise.sdk</groupId>
        <artifactId>arcgis-enterprise-sdk</artifactId>
        <version>12.2.0</version>
        <scope>provided</scope>
    </dependency>
    <!-- Include any additional project dependencies here if needed -->
</dependencies>
</project>

The provided scope makes SDK APIs available at compile time without bundling the SDK JAR into the extension package. ArcGIS Server supplies the required SDK runtime libraries.

Set the Java compiler release to the version required by the SDK. For example, the public 12.1 documentation specifies JDK 21; verify the JDK requirement for your 12.2 build before using the following setting:

Use dark colors for code blocksCopy
1
2
3
4
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>21</maven.compiler.release>
</properties>

Enterprise SDK Maven plugin (sdk-plugin.jar)

The sdk-plugin.jar file contains a build plug-in that packages and generates an .soe file in the project's target folder during project build. For SOAP SOEs, the plugin can also generate a Web Services Description Language (.wsdl) file during the generate-resources phase. When an SOE or SOI project is created from the archetype, sdk-plugin will be added automatically as a build plugin in the project's POM (see POM plugins).

The SDK archetypes configure the plugin in the generated pom.xml file. The following example shows the packaging goal:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<build>
    <plugins>
        <plugin>
            <groupId>com.esri.arcgis.enterprise.sdk</groupId>
            <artifactId>sdk-plugin</artifactId>
            <version>12.2.0</version>
            <dependencies>
                <!-- Include any additional plugin dependencies here if needed -->
            </dependencies>
            <configuration>
                <configProp>
                    <Version>1.0</Version>
                    <Author>AuthorName</Author>
                    <Company>CompanyName</Company>
                    <TARGETS>12.2</TARGETS> <!-- Required -->
                </configProp>
            </configuration>
            <executions>
                <!--The following execution is required in SOAP SOE-->
                <!--execution>
                    <id>generate-wsdl-goal</id>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>generate-wsdl</goal>
                    </goals>
                </execution-->
                <execution>
                    <id>package-soe-goal</id>
                    <phase>package</phase>
                    <goals>
                        <goal>package-soe</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

For a SOAP SOE, the generated POM also configures the generate-wsdl goal. Retain the archetype-generated WSDL configuration rather than applying the REST-only example to a SOAP project.

SOE and SOI Maven archetypes

Maven archetypes generate starter projects with the required directory structure, build configuration, and example code. ArcGIS Enterprise SDK supplies four archetypes for SOE and SOI development:

ArchetypeProject type
rest-soe-archetypeREST SOE
soap-soe-archetypeSOAP SOE
rest-soap-soe-archetypeSOE supporting REST and SOAP
soi-archetypeSOI

All four archetypes use the Maven group ID com.esri.arcgis.enterprise.sdk. Use the archetype version installed with the SDK. For an SOE that exposes both REST and SOAP operations, start with rest-soap-soe-archetype.

Maven archetypes help create a ready-to-use SOE or SOI project from a Maven project template that consists of metadata defining how the project is constructed and built. ArcGIS Enterprise SDK provides the four archetypes above. They have the same groupId com.esri.arcgis.enterprise.sdk and version 12.2.0 (for 12.0 Enterprise SDK, use 12.2.0 as the version value), with artifactId rest-soe-archetype for building REST SOEs, soap-soe-archetype for building SOAP SOEs, rest-soap-soe-archetype for SOEs that support both REST and SOAP functions, and soi-archetype for SOIs.

Manage SOE and SOI projects with Maven

Manage dependencies

Maven project configuration is defined in a Project Object Model (pom.xml) file. Declare required libraries under <dependencies> using their Maven group ID, artifact ID, and version. Maven resolves dependencies from your local repository and configured remote repositories.

If a third-party JAR is not available from a Maven repository, you can install it locally with the following command:

Use dark colors for code blocksCopy
1
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=jar
  • <path-to-file> is the path of the JAR file, for example, C:\Projects\soehelper.jar.
  • <group-id>, <artifact-id>, and <version> are defined by you and will be referenced later in the pom.xml file of the SOE or SOI project.

Create a project

There are two ways to create an SOE or SOI project from the Maven archetypes, using either a Java IDE or the Maven command from the command line. To learn more about creating an SOE or SOI using a Java IDE, refer to the SOE or SOI section. This topic only discusses using Maven command to create an SOE or SOI project.

Use Maven command in interactive mode

You can open the command prompt and use the following Maven commands to create projects in interactive mode:

For REST SOE, use this command:

Use dark colors for code blocksCopy
1
mvn archetype:generate -DarchetypeGroupId=com.esri.arcgis.enterprise.sdk -DarchetypeArtifactId=rest-soe-archetype -DarchetypeVersion=12.2.0

For SOAP SOE, use this command:

Use dark colors for code blocksCopy
1
mvn archetype:generate -DarchetypeGroupId=com.esri.arcgis.enterprise.sdk -DarchetypeArtifactId=soap-soe-archetype -DarchetypeVersion=12.2.0

For REST SOAP SOE, use this command:

Use dark colors for code blocksCopy
1
mvn archetype:generate -DarchetypeGroupId=com.esri.arcgis.enterprise.sdk -DarchetypeArtifactId=rest-soap-soe-archetype -DarchetypeVersion=12.2.0

For SOI, use this command:

Use dark colors for code blocksCopy
1
mvn archetype:generate -DarchetypeGroupId=com.esri.arcgis.enterprise.sdk -DarchetypeArtifactId=soi-archetype -DarchetypeVersion=12.2.0

The principal project properties are:

PropertyDescription
groupIdProject identifier, typically based on a reversed domain name.
artifactIdMaven project identifier, also used to name the generated extension package.
versionProject version, such as 1.0-SNAPSHOT.
packageJava package for generated source code.
soeNameGenerated SOE class name, required for SOE archetypes.
soiNameGenerated SOI class name, required for the SOI archetype.

Use Maven command in non-interactive mode

If you would like to create the SOE or SOI project without the interactivity, you can set the interactive property to false (-DinteractiveMode=false), or use the -B flag (see generate project in batch mode).

For example, the following command will create a REST SOE project without asking you to type each property one by one or confirming your inputs:

Use dark colors for code blocksCopy
1
mvn archetype:generate -B -DarchetypeGroupId=com.esri.arcgis.enterprise.sdk -DarchetypeArtifactId=rest-soe-archetype -DarchetypeVersion=12.0.0 -DsoeName=TestSimpleRESTSOE -DgroupId=com.soe.demo -DartifactId=SimpleRESTSOEDemo -Dversion=1.0

For other versions of Enterprise SDK, remember to change -DarchetypeVersion to the corresponding version of the SDK, such as -DarchetypeVersion=11.5.0 for 11.5.0 Enterprise SDK and -DarchetypeVersion=11.4.0 for 11.4.0 Enterprise SDK.

Build a project

Maven builds projects through lifecycle phases such as compile, test, package, and install. Running a phase also runs the preceding applicable phases in that lifecycle.

To remove generated files and build the extension, run the following command from the project directory:

Use dark colors for code blocksCopy
1
mvn clean package

The SDK Maven plugin generates the .soe package in the target directory. For SOAP SOEs, a .wsdl file can also be generated when the corresponding plugin goal is configured.

To build the project and install its Maven artifact into your local repository, run:

Use dark colors for code blocksCopy
1
C:\Users\sdkuser\projects\SimpleRESTSOEDemo>mvn clean install

See the Build Lifecycle Maven article for more details about different lifecycle phases.

The Maven deploy phase publishes a Maven artifact to a configured remote Maven repository. It does not register or enable the SOE or SOI on ArcGIS Server. To use a built extension, deploy its .soe package and enable it on the target ArcGIS Server service. See Deploy extensions for the ArcGIS Server workflow.

Also See

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.