Changes

Jump to navigation Jump to search
980 bytes added ,  15:56, 17 January 2016
no edit summary
This page is part of the [[Developer Section]]. It demonstrates how [http://maven.apache.org Maven] is used to compile and run BaseX, and embed it into other projects.
 
==Using Maven==
If you have [[Git|cloned our repository]] and installed Maven on your machine,you can run the standalone version of [httpfollowing commands from all local repository directories* <code>mvn compile</code>: the BaseX source files are compiled.* <code>mvn package</mavencode>: JAR archives are created in the {{Code|target}} class directory, and all relevant libraries are created in the {{Code|lib}} directory.apachePackaging is useful if you want to use the start scripts.org * <code>mvn install</code>: the JAR archive is installed to the local repository, and made available to other Maven] projects. This is installedparticularly useful if you are compiling a beta version of BaseX,for which no archives exist in the repositories. By adding the flag <code>-DskipTests</code> you can skip the JUnit tests and speed up packaging. You may as well use the following commands in any of [[Developing with Eclipse|Eclipse and m2eclipse]] to compile the BaseX repositories:sources.
* <code>mvn compile</code>There are several alternatives for starting BaseX: the BaseX source files are is compiled * <code>mvn package<type in {{Code|java -cp target/code>: a JAR archive is created classes org.basex.BaseX}} in the <code>target</code> class {{Code|basex-core}} directoryto start BaseX on the command-line mode,* <code>type in {{Code|mvn install</code>jetty: run}} in the JAR archive is installed {{Code|basex-api}} directory to start BaseX with Jetty and the local repository; this wayHTTP servers, it will be found by other Maven projects. This is particularly useful if you are compiling a beta version * run one of BaseX, for which no archives exist the [[Start Scripts]] contained in the repositories.{{Code|etc}} directory
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 You can easily embed it BaseX into your own Maven projects.To use the BaseX Maven Artifacts, add by adding the following lines XML snippets to your<code>{{Code|pom.xml</code> }} file:</p>  
<pre class="brush:xml">&lt;repositories&gt;
&lt;repository&gt;
&lt;/repositories&gt;</pre>
===BaseXMain Package===
<pre class="brush:xml">&lt;dependency&gt;
&lt;groupId&gt;org.basex&lt;/groupId&gt;
&lt;artifactId&gt;basex&lt;/artifactId&gt;
&lt;version&gt;6.7.16&lt;/version&gt;
&lt;/dependency&gt;</pre>
===BaseX APIAPIs and Services=== <p>...including APIs and the [[REST]], [http://sourceforge.net/projects/xmldb-org XML:DB[RESTXQ]]and [http://jcp.org/en/jsr/detail?id=225 XQJ[WebDAV]] APIsservices:</p>
<pre class="brush:xml">&lt;dependency&gt;
&lt;groupId&gt;org.basex&lt;/groupId&gt;
&lt;artifactId&gt;basex-api&lt;/artifactId&gt;
&lt;version&gt;6.7.16&lt;/version&gt;
&lt;/dependency&gt;</pre>
[[Category===XQJ API=== <p>The XQJ API is hosted at http:Developer]]//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.2.0</version></dependency><dependency> <groupId>com.xqj2</groupId> <artifactId>xqj2</artifactId> <version>0.1.0</version></dependency><dependency> <groupId>javax.xml.xquery</groupId> <artifactId>xqj-api</artifactId> <version>1.0</version></dependency></pre>
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu