Difference between revisions of "Maven"

From BaseX Documentation
Jump to navigation Jump to search
Line 1: Line 1:
 +
==Using Maven==
 +
 +
If the standalone version of [http://maven.apache.org Maven] is installed,
 +
you can use the following commands in any of the BaseX repositories:
 +
 +
* <code>mvn compile</code>: the BaseX source files are is compiled
 +
* <code>mvn package</code>: a JAR archive is created in the <code>target</code> class directory
 +
* <code>mvn install</code>: the JAR archive is installed to the local repository; this way, it will be found by other Maven projects. This is  particularly useful if you are compiling a beta version of BaseX, for which no archives exist in the repositories.
 +
 +
To launch BaseX, type in <code>java -cp target/classes org.basex.BaseX</code>, or have a look at our [[Start Scripts]].
 +
 +
By adding the flag <code>-DskipTests=true</code> you can skip running the JUnit tests and speed up the packaging procedure. You may as well use [[Integrate|Eclipse and m2eclipse]] to compile the BaseX sources.
 +
 +
==Artifacts==
 +
 
<p>As BaseX is offered in a Maven repository, you can easily embed and [[Integrate|integrate]] it into your own projects.
 
<p>As BaseX is offered in a Maven repository, you can easily embed and [[Integrate|integrate]] it into your own projects.
 
To use the BaseX Maven Artifacts, add the following lines to your
 
To use the BaseX Maven Artifacts, add the following lines to your
Line 10: Line 25:
 
&lt;/repositories&gt;</pre>  
 
&lt;/repositories&gt;</pre>  
 
   
 
   
===BaseX Artifact===  
+
===BaseX===  
 
<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 17: Line 32:
 
&lt;/dependency&gt;</pre>
 
&lt;/dependency&gt;</pre>
  
===BaseX API Artifact===  
+
===BaseX API===  
 
<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>  
Line 25: Line 40:
 
   &lt;version&gt;6.7.1&lt;/version&gt;
 
   &lt;version&gt;6.7.1&lt;/version&gt;
 
&lt;/dependency&gt;</pre>
 
&lt;/dependency&gt;</pre>
 +
 
[[Category:Developer]]
 
[[Category:Developer]]

Revision as of 06:04, 22 September 2011

Using Maven

If the standalone version of Maven is installed, you can use the following commands in any of the BaseX repositories:

  • mvn compile: the BaseX source files are is compiled
  • mvn package: a JAR archive is created in the target class directory
  • mvn install: the JAR archive is installed to the local repository; this way, it will be found by other Maven projects. This is particularly useful if you are compiling a beta version of BaseX, for which no archives exist in the repositories.

To launch BaseX, type in java -cp target/classes org.basex.BaseX, or have a look at our Start Scripts.

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

As BaseX is offered in a Maven repository, you can easily embed and integrate it into your own projects. To use the BaseX Maven Artifacts, add the following lines 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

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

BaseX API

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

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