Title: Using Jena with Apache Maven
[Apache Maven](http://maven.apache.org) is a tool to help Java projects manage
their dependencies on library code, such as Jena. By declaring a dependency on
the core of Jena in your project's pom.xml
file, you will get the
consistent set of library files that Jena depends on automatically added too.
This page assumes you have Maven installed on your computer. If this is not the case,
please read and follow [these instructions](http://maven.apache.org/download.html#Installation).
### Repositories
Released maven artifacts are mirrored to the central maven repositories.
This can take a few days.
The Jena repositories at Apache are:
* [https://repository.apache.org/content/repositories/releases/](https://repository.apache.org/content/repositories/releases/) for released versions
* [https://repository.apache.org/content/repositories/snapshots/](https://repository.apache.org/content/repositories/snapshots/) for development builds.
Stable Jena releases are automatically mirrored by the central Maven
repositories, so there will normally be no need to add any extra
repositories to your pom.xml
or settings.xml
.
### Specifying Jena or ARQ as a dependency
This is how to specify in your pom.xml file the dependency
on a version of Jena and ARQ stable releases:
org.apache.jena
jena-arq
2.9.3
You do not need to specify a dependency on Jena, since ARQ depends on Jena and Maven
will transitively resolve all the dependencies for you (including Jena).
If you do need to use the Apache release repository, add the following to
the <repositories>
section of your pom.xml
.
apache-repo-releases
https://repository.apache.org/content/repositories/releases/
true
Please check for the latest versions.
The artifacts are:
* jena-core
* jena-arq
* jena-iri
* jena-tdb
* jena-fuseki
* jena-larq
* jena-sdb
You can run mvn dependency:tree
to print the dependency
tree.
### Specifying TDB or SDB as dependencies
For TDB, this is what you should use to point to the latest release:
org.apache.jena
jena-tdb
0.9.3
The artifact id for SDB is jena-sdb
.
Once again, since SDB and TDB depend on Jena and ARQ
this is all you need in your pom.xml
file.
Please note that Apache releases of SDB have not yet been done.
### Specifying dependencies on SNAPSHOTs
If you want to depend on Jena development snapshots, e.g. to get access
to recent bug fixes, you should add the following to your pom.xml
:
apache-repo-snapshots
https://repository.apache.org/content/repositories/snapshots/
false
true
For the current Jena SNAPSHOT use:
org.apache.jena
jena-core
2.7.4-SNAPSHOT
For the current ARQ SNAPSHOT use:
org.apache.jena
jena-arq
2.9.4-SNAPSHOT
For the current TDB SNAPSHOT use:
org.apache.jena
jena-tdb
0.9.4-SNAPSHOT
### Build and install artifacts in your local Maven repository
If you want you can checkout the Jena sources, build the artifacts and
install them in your local Maven repository, then you simply checkout the source
tree and build with maven
mvn install
. This assumes you have Maven and Subversion installed:
svn co https://svn.apache.org/repos/asf/jena/trunk/ Jena
cd Jena
mvn clean install
Each of the modules can be built on it's own but they require the current snapshots and Jena parent POM to be installed.