Difference between revisions of "Maven"

From BaseX Documentation
Jump to navigation Jump to search
Line 24: Line 24:
 
&lt;/repositories&gt;</pre>  
 
&lt;/repositories&gt;</pre>  
 
   
 
   
===BaseX===  
+
===BaseX Main Package===  
 
<pre class="brush:xml">&lt;dependency&gt;
 
<pre class="brush:xml">&lt;dependency&gt;
 
   &lt;groupId&gt;org.basex&lt;/groupId&gt;
 
   &lt;groupId&gt;org.basex&lt;/groupId&gt;
Line 31: Line 31:
 
&lt;/dependency&gt;</pre>
 
&lt;/dependency&gt;</pre>
  
===BaseX API===  
+
===BaseX APIs===  
 
<p>...including the [[REST]], [http://sourceforge.net/projects/xmldb-org XML:DB]
 
<p>...including the [[REST]], [http://sourceforge.net/projects/xmldb-org XML:DB]
 
and [http://jcp.org/en/jsr/detail?id=225 XQJ] APIs:</p>  
 
and [http://jcp.org/en/jsr/detail?id=225 XQJ] APIs:</p>  

Revision as of 02:07, 26 January 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>6.7.1</version>
</dependency>

BaseX APIs

...including the REST, XML:DB and XQJ APIs:

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