#pluginrepository
Explore tagged Tumblr posts
mrrolandtfranco · 8 years ago
Text
Dependency Management with ArcGIS Runtime SDK for Java
ArcGIS Runtime SDK for Java 100.0.0 now supports downloading the SDK through dependency management.  Most projects are not self-contained, instead they require dependent libraries to be compiled or tested.  In the case of ArcGIS Java projects the requirement includes a Java Jar file, native libraries, and resources.  Furthermore, our Java Jar file has dependencies on third party SDK’s, these are called transitive dependencies.  Dependency management can greatly simplify maintaining multi-module dependency projects and the ArcGIS Runtime SDK for Java now supports Gradle and Maven dependency management workflows. 
Custom Maven Repository
We distribute both our Gradle and Maven dependencies and plugins through a custom maven repository http://ift.tt/1Li93Y4.  You provide this URL to your projects build scripts to include it as a server to discover the ArcGIS Java SDK Gradle and Maven plugins.
Gradle
Gradle is an open source build automation tool that uses Groovy as it’s domain specific language (DSL).  With the release of ArcGIS Java 100.0.0 we include a custom Gradle plugin to handle all of the dependencies required by the SDK.
There are 4 requirements you must add to your build.gradle buildscript:
Apply the ArcGIS Java SDK Plugin
Provide the custom maven repository url
Add the ArcGIS Java SDK plugin classpath dependency
Add the version of the ArcGIS SDK
The groovy code below shows how to add these 4 requirements in a simplified build.gradle buildscript.
// apply the ArcGIS Java SDK plugiun apply plugin: 'com.esri.arcgisruntime.java' buildscript { repositories { // provide custom maven url maven { url 'http://ift.tt/1Li93Y4' } } dependencies { // ArcGIS Java plugin dependency classpath 'com.esri.arcgisruntime:gradle-arcgis-java-plugin:1.0.0' } } // specify the Java SDK version version arcgis.version = '100.0.0'
The SDK’s native libraries and resources will be downloaded to $USER_HOME/.arcgis/[version], e.g. $USER_HOME/.arcgis/100.0.0. You should see the log messages the first time you build the project indicating that the libs and resources are being downloaded.
You can see the Gradle developer workflow in our Gradle Callout demo. Gradle is also used in the ArcGIS Java SDK Samples. We recommend reading Getting Started with Gradle if you are new to Gradle.
Maven
Maven is an open source build automation tool that uses XML for declaring project configuration. To pull the plugin you need to provide a pluginRepositories config and include the plugin in your build config:
<pluginRepositories> <pluginRepository> <id>esri-arcgis</id> <url>http://ift.tt/2iTBPk6; </pluginRepository> </pluginRepositories> <build> <plugins> <plugin> <groupId>com.esri.arcgisruntime</groupId> <artifactId>arcgis-java-maven-plugin</artifactId> <version>1.0</version> <configuration> <version>100.0.0</version> </configuration> </plugin> </plugins> </build>
Once you have the plugin it will need to know where the SDK libraries are located. You do this with the following SDK dependency:
<dependencies> <dependency> <groupId>com.esri.arcgisruntime</groupId> <artifactId>arcgis-java</artifactId> <version>100.0.0</version> </dependency> </dependencies>
As with Gradle, the SDK’s native libraries and resources will be downloaded to $USER_HOME/.arcgis/[version] directory. Below is the full requirements you need in your apps POM file:
<project> <!-- Project configuration... --> <repositories> <repository> <id>esri-arcgis</id> <url>http://ift.tt/2iTBPk6; </repository> </repositories> <pluginRepositories> <pluginRepository> <id>esri-arcgis</id> <url>http://ift.tt/2iTBPk6; </pluginRepository> </pluginRepositories> <dependencies> <dependency> <groupId>com.esri.arcgisruntime</groupId> <artifactId>arcgis-java</artifactId> <version>100.0.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>com.esri.arcgisruntime</groupId> <artifactId>arcgis-java-maven-plugin</artifactId> <version>1.0</version> <configuration> <version>100.0.0</version> </configuration> </plugin> </plugins> </build> </project>
You can see the maven developer workflow in our Maven Callout demo. We recommend reading Maven in 5 minutes if you are new to Maven.
from ArcGIS Blog http://ift.tt/2iTEaMb
0 notes