Jul 16
Building an InfiniteGraph Application with Maven
Here are the steps to get the graph data store, InfiniteGraph, working with a Maven project management environment. The codebase is a small social network application.
- mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.infinitegraph.sample -DartifactId=GraphAPISample
- Use this POM w/ filesystem dependency
- Copy GraphAPISample.java to src/main/java/com/infinitegraph/sample
- Add GraphAPISample to package com.infinitegraph.sample
- Create a resources directory for your properties file with ‘mkdir src/main/resources’
- Copy SampleGraphProperties.properties to the resources directory. Note, this will move to the target directory during the compile step, so it can be picked up at runtime without path qualification. Therefore, take out the path in your code, for example: GraphFactory.open(“SampleGraph”, “SampleGraphProperties.properties”);
- mvn compile
- mvn exec:exec
Make sure you have the distributed lockserver running in advance and source the IGConfg script. If you are new to Maven, it might be easier to download my whole setup. Or get it from GitHub via “git clone git@github.com:toddstavish/InfiniteGraph-Maven-Example-Setup.git.” If you have any suggestions or questions, you can reach me here.
