After selecting the appropriate edition for your platform, embed Neo4j in your Java application by including the Neo4j library jars in your build.
Get the Neo4j libraries from one of these sources:
Add the jar files to your project:
-classpath
For an overview of the main Neo4j artifacts, see Table 1.2, “Neo4j editions”. The artifacts listed there are top-level artifacts that will transitively include the actual Neo4j implementation. You can either go with the top-level artifact or include the individual components directly. The examples included here use the top-level artifact approach.
Maven dependency.
<project> ... <dependencies> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j</artifactId> <version>${neo4j-version}</version> </dependency> ... </dependencies> ... </project>
Where ${neo4j-version}
is the intended version and the artifactId
is found in Table 1.2, “Neo4j editions”.
Make sure to resolve dependencies from Maven Central, for example using this configuration in your ivysettings.xml file:
<ivysettings> <settings defaultResolver="main"/> <resolvers> <chain name="main"> <filesystem name="local"> <artifact pattern="${ivy.settings.dir}/repository/[artifact]-[revision].[ext]" /> </filesystem> <ibiblio name="maven_central" root="http://repo1.maven.org/maven2/" m2compatible="true"/> </chain> </resolvers> </ivysettings>
With that in place you can add Neo4j to the mix by having something along these lines to your ivy.xml file:
.. <dependencies> .. <dependency org="org.neo4j" name="neo4j" rev="${neo4j-version}"/> .. </dependencies> ..
Where ${neo4j-version}
is the intended version and the name
is found in Table 1.2, “Neo4j editions”.
Copyright © 2011 Neo Technology