Forum: Building VoltDB Applications

Post: Maven repository for client jars?

Maven repository for client jars?
cer
Feb 4, 2012
As far as I can tell the voltdb client jar is not in a maven repository?
Is that correct?
Given that most modern java build tools use a repository it's very old-school to not have jars available via a repository. It forces uses to download the jar and manually install in in their maven repo.
The way I solved this issue
tarun
Jun 5, 2012
The way I solved this issue is by using maven-external-dependency-plugin : http://code.google.com/p/maven-external-dependency-plugin/. Added the plugin in the POM file which looks something like this :
(Note : For simplicity's sake, I've omitted some of the required dependencies. Please visit this link for full details http://code.google.com/p/maven-external-dependency-plugin/source/browse/trunk/maven-external-dependency-plugin-test/pom.xml )

<build>
<plugins>
<plugin>
<groupId>com.savage7.maven.plugins</groupId>
<artifactId>maven-external-dependency-plugin</artifactId>
<version>0.5</version>
<inherited>false</inherited>
<configuration>
<stagingDirectory>
${project.build.directory}/dependencies/
</stagingDirectory>
<createChecksum>true</createChecksum>
<skipChecksumVerification>true</skipChecksumVerification>
<force>false</force>
<artifactItems>
<!-- THIS JAR IS NOT HOSTED ON Maven Repo, Downloading from Voltdb site-->
<artifactItem>
<groupId>org.voltdb</groupId>
<artifactId>voltdb</artifactId>
<version>2.7</version>
<packaging>jar</packaging>
<downloadUrl>
http://community.voltdb.com/sites/default/files/archive/{version}/LINUX-voltdb-{version}.tar.gz
</downloadUrl>
<extractFile>voltdb-{version}/voltdb/voltdb-{version}.jar</extractFile>
</artifactItem>
<artifactItem>
<groupId>org.voltdb</groupId>
<artifactId>voltdbclient</artifactId>
<version>2.7</version>
<packaging>jar</packaging>
<downloadUrl>
http://community.voltdb.com/sites/default/files/archive/{version}/LINUX-voltdb-{version}.tar.gz
</downloadUrl>
<extractFile>voltdb-{version}/voltdb/voltdbclient-{version}.jar</extractFile>
</artifactItem>
</artifactItems>
</configuration>
<executions>
<execution>
<id>clean-external-dependencies</id>
<phase>clean</phase>
<goals>
<!-- mvn com.savage7.maven.plugins:maven-external-dependency-plugin:clean-external -->
<goal>clean-external</goal>
</goals>
</execution>
<execution>
<id>resolve-install-external-dependencies</id>
<phase>process-resources</phase>
<goals>
<!-- mvn com.savage7.maven.plugins:maven-external-dependency-plugin:resolve-external -->
<goal>resolve-external</goal>

<!-- mvn com.savage7.maven.plugins:maven-external-dependency-plugin:install-external -->
<goal>install-external</goal>
</goals>
</execution>
<execution>
<id>deploy-external-dependencies</id>
<phase>deploy</phase>
<goals>
<!-- mvn com.savage7.maven.plugins:maven-external-dependency-plugin:deploy-external -->
<goal>deploy-external</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>