Difference between revisions of "Maven"

From BaseX Documentation
Jump to navigation Jump to search
Line 31: Line 31:
 
&lt;/dependency&gt;</pre>
 
&lt;/dependency&gt;</pre>
  
===BaseX APIs===  
+
===APIs and Services===  
 
<p>...including APIs and the [[REST]], [[RESTXQ]] and [[WebDAV]] services:</p>  
 
<p>...including APIs and the [[REST]], [[RESTXQ]] and [[WebDAV]] services:</p>  
 
<pre class="brush:xml">&lt;dependency&gt;
 
<pre class="brush:xml">&lt;dependency&gt;
Line 38: Line 38:
 
   &lt;version&gt;7.2.1&lt;/version&gt;
 
   &lt;version&gt;7.2.1&lt;/version&gt;
 
&lt;/dependency&gt;</pre>
 
&lt;/dependency&gt;</pre>
 +
 +
===XQJ API===
 +
<p>The XQJ API is hosted at http://xqj.net:</p>
 +
<pre class="brush:xml">
 +
<repository>
 +
  <id>xqj</id>
 +
  <name>XQJ Maven Repository</name>
 +
  <url>http://xqj.net/maven</url>
 +
</repository>
 +
...
 +
<dependency>
 +
  <groupId>net.xqj</groupId>
 +
  <artifactId>basex-xqj</artifactId>
 +
  <version>1.0.0</version>
 +
</dependency>
 +
<dependency>
 +
  <groupId>com.xqj2</groupId>
 +
  <artifactId>xqj2</artifactId>
 +
  <version>0.0.1</version>
 +
</dependency>
 +
<dependency>
 +
  <groupId>javax.xml.xquery</groupId>
 +
  <artifactId>xqj-api</artifactId>
 +
  <version>1.0</version>
 +
</dependency>
 +
</pre>
 +
  
 
[[Category:Developer]]
 
[[Category:Developer]]

Revision as of 15:33, 10 May 2012

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 repositories and installed Maven on your machine, you can run the following commands from all local repository directories:

  • mvn compile: the BaseX source files are compiled. To launch the project, type in java -cp target/classes org.basex.BaseX, or have a look at our Start Scripts.
  • mvn package: JAR archives are created in the target class directory.
  • mvn install: 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.

By adding the flag -DskipTests=true you can skip running the JUnit tests and speed up the packaging procedure. You may as well use Eclipse and m2eclipse to compile the BaseX sources.

Artifacts

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

<repositories>
  <repository>
    <id>basex</id>
    <name>BaseX Maven Repository</name>
    <url>http://files.basex.org/maven</url>
  </repository>
</repositories>

BaseX Main Package

<dependency>
  <groupId>org.basex</groupId>
  <artifactId>basex</artifactId>
  <version>7.2.1</version>
</dependency>

APIs and Services

...including APIs and the REST, RESTXQ and WebDAV services:

<dependency>
  <groupId>org.basex</groupId>
  <artifactId>basex-api</artifactId>
  <version>7.2.1</version>
</dependency>

XQJ API

The XQJ API is hosted at http://xqj.net:

<repository>
  <id>xqj</id>
  <name>XQJ Maven Repository</name>
  <url>http://xqj.net/maven</url>
</repository>
...
<dependency>
  <groupId>net.xqj</groupId>
  <artifactId>basex-xqj</artifactId>
  <version>1.0.0</version>
</dependency>
<dependency>
  <groupId>com.xqj2</groupId>
  <artifactId>xqj2</artifactId>
  <version>0.0.1</version>
</dependency>
<dependency>
  <groupId>javax.xml.xquery</groupId>
  <artifactId>xqj-api</artifactId>
  <version>1.0</version>
</dependency>