INSTALLING VOLTDB IN LOCAL MAVEN REPOSITORY

written by vdbdev on October 24, 2013 with no comments

This is a topic that has come up quite often as to how to use VoltDB client libraries if I use Maven. Although VoltDB is not part of the Maven Central repository, we can work around this by installing the libraries locally in the local repository for maven.

First I downloaded and installed VoltDB. Let’s say I installed in /opt/voltdb/. The library that I need for Client side development is:

voltdb-4.x.x.jar located under the voltdb subdirectory

You will need to install the voltdb library in the local Maven repository. This can be done using the following command:

mvn install:install-file -Dfile=~/voltdb-4.x.x/voltdb/voltdb-4.x.x.jar \
    -DgroupId=org.voltdb -DartifactId=voltdb-client -Dversion=4.x.x
    -Dpackaging=jar

This gave me access to the artifact voltdbclient from my local repository. I am then able to use it in my POM files as a dependency as follows:
“`xml

org.voltdb
voltdb-client
4.x.x

“`
When upgrading VoltDB, I just delete the directory org/voltdb/voltdb-client from my local repository and re-install the library as discussed above.