Maven

This page is part of the Developer Section. It demonstrates how Maven is used to compile and run BaseX, and embed it into other projects.

Using Maven
If you have cloned our repository and installed Maven on your machine, you can run the following commands from all local repository directories:

By adding the flag  you can skip the JUnit tests and speed up packaging. You may as well use Eclipse and m2eclipse to compile the BaseX sources.
 * : the BaseX source files are compiled.
 * : JAR archives are created in the target class directory, and all relevant libraries are created in the lib directory. Packaging is useful if you want to use the start scripts.
 * : the JAR archive is installed to the local repository, and made available to other Maven projects. This is particularly useful if you are compiling a beta version of BaseX, for which no archives exist in the repositories.

There are several alternatives for starting BaseX:


 * type in java -cp target/classes org.basex.BaseX in the basex-core directory to start BaseX on the command-line mode,
 * type in mvn jetty:run in the basex-api directory to start BaseX with Jetty and the HTTP servers,
 * run one of the Start Scripts contained in the etc directory

Artifacts
You can easily embed BaseX into your own Maven projects by adding the following XML snippets to your pom.xml file:

&lt;repositories&gt; &lt;repository&gt; &lt;id&gt;basex&lt;/id&gt; &lt;name&gt;BaseX Maven Repository&lt;/name&gt; &lt;url&gt;http://files.basex.org/maven&lt;/url&gt; &lt;/repository&gt; &lt;/repositories&gt;

BaseX Main Package
&lt;dependency&gt; &lt;groupId&gt;org.basex&lt;/groupId&gt; &lt;artifactId&gt;basex&lt;/artifactId&gt; &lt;version&gt;7.6&lt;/version&gt; &lt;/dependency&gt;

APIs and Services
...including APIs and the REST, RESTXQ and WebDAV services: &lt;dependency&gt; &lt;groupId&gt;org.basex&lt;/groupId&gt; &lt;artifactId&gt;basex-api&lt;/artifactId&gt; &lt;version&gt;7.6&lt;/version&gt; &lt;/dependency&gt;

XQJ API
The XQJ API is hosted at http://xqj.net:  xqj XQJ Maven Repository http://xqj.net/maven ... net.xqj basex-xqj 1.2.0  com.xqj2 xqj2 0.1.0  javax.xml.xquery xqj-api</artifactId> 1.0