This article explains how you can make LuciadLightspeed available through Apache Maven. Maven is a development project management and build automation tool. More information is available on its website: http://maven.apache.org/.

Deploying to a repository

Luciad provides POM files for all libraries available in LuciadLightspeed. Those are available in the build/maven/pom directory. They can easily be deployed to your repository by running the Ant script deploy.xml in the build/maven directory. The script asks for a URL and credentials to the Maven repository, and proceeds to deploy all available libraries.

The deployment script requires at least Ant 1.9.1 and the Maven tasks antlib. Recent versions of these are provided in the build/ant directory of the LuciadLightspeed installation. Support for protocols other than file and http is available through Wagon (http://maven.apache.org/wagon/).

Using the libraries

You can use the Luciad libraries like any other Maven dependency by adding them to your project POM.

Program: Adding a Luciad dependency
<dependency>
  <groupId>com.luciad</groupId>
  <artifactId>lcd_lightspeed</artifactId>
  <version>${luciad.version}</version>
</dependency>

It is recommended to define a Maven property for the LuciadLightspeed version as a value placeholder, to prevent an accidental mixing of versions. As a result, you only have to update the version number once when you upgrade to a new LuciadLightspeed version.

Adding a license

A license for LuciadLightspeed is not automatically uploaded to the repository. You can do so manually by means of Maven’s deploy-file goal, as in the example below.

Program: Adding a license
mvn deploy:deploy-file \
  -DgroupId=com.yourcompany \               # do not use com.luciad
  -DartifactId=luciad_development_license \
  -Dversion=2016.0-20160121 \               # for instance the date that the license was received
  -Dpackaging=jar \
  -Dfile=development.jar \
  -Durl=yourCompanyRepositoryUrl

In your project’s pom.xml, you should then specify:

Program: Adding a license
<dependency>
  <groupId>com.yourcompany</groupId>
  <artifactId>luciad_development_license</artifactId>
  <version>2016.0-20160121</version>
</dependency>