<p>As BaseX This page is offered in a Maven repository, you can easily embed and part of the [[Integrate|integrateDeveloper Section]]. It demonstrates how [https://maven.apache.org Maven] is used to compile and run BaseX, and embed it into your own other projects.To use the BaseX ==Using Maven== If you have [[Git|cloned our repository]] and installed Maven Artifactson your machine, add you can run the following lines to yourcommands from all local repository directories: * <code>pom.xmlmvn compile</code> file:the BaseX source files are compiled.* </pcode> mvn package<pre class="brush:xml"/code><repositories> <repository> <id>basex</id> <name>BaseX Maven Repository</name> <url>http://filesJAR archives are created in the {{Code|target}} class directory, and all relevant libraries are created in the {{Code|lib}} directory.basexPackaging is useful if you want to use the start scripts.org/maven</url> <* <code>mvn install</code>: 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></pre> .
By adding the flag <code>-DskipTests</code> you can skip the JUnit tests and speed up packaging. You may as well use [[Developing with Eclipse|Eclipse and m2eclipse]] to compile the BaseX sources. There are several alternatives for starting BaseX: * type in {{Code|java -cp target/classes org.basex.BaseX}} in the {{Code|basex-core}} directory to start BaseX on the command-line mode,* type in {{Code|mvn jetty:run}} in the {{Code|basex-api}} directory to start BaseX with Jetty and the HTTP servers,* run one of the [[Start Scripts]] contained in the {{Code|etc}} directory ==Artifacts== You can easily embed BaseX into your own Maven projects by adding the following XML snippets to your {{Code|pom.xml}} file: <syntaxhighlight lang="xml"><repositories> <repository> <id>basex</id> <name>BaseX Maven Repository</name> <url>http://files.basex.org/maven</url> </repository></repositories></syntaxhighlight> ===BaseX ArtifactMain Package=== <pre classsyntaxhighlight lang="brush:xml"><<dependency>> <<groupId>>org.basex<</groupId>> <<artifactId>>basex<</artifactId>> <<version>>7.6</version></dependency></syntaxhighlight> ===APIs and Services=== <p>...including APIs and the [[REST]], [[RESTXQ]] and [[WebDAV]] services:</p> <syntaxhighlight lang="xml"><dependency> <groupId>org.basex</groupId> <artifactId>basex-api</artifactId> <version>7.1<6</version>><</dependency>></presyntaxhighlight> ===XQJ API===
===BaseX API Artifact=== <p>...including the [[REST]], [The XQJ API is hosted at http://sourceforgexqj.net:</projectsp> <syntaxhighlight lang="xml"><repository> <id>xqj</xmldb-org XML:DB]id> <name>XQJ Maven Repository</name>and [ <url>http://jcpxqj.orgnet/enmaven</jsr/detail?id=225 XQJ] APIs:url></prepository> ...<pre class="brush:xml"dependency><dependency> <<groupId>org>net.basex<xqj</groupId>> <<artifactId>>basex-api<xqj</artifactId>> <<version>1.2.0</version>6></dependency><dependency> <groupId>com.7xqj2</groupId> <artifactId>xqj2</artifactId> <version>0.1<.0</version>><</dependency>><dependency> <groupId>javax.xml.xquery</groupId> <artifactId>xqj-api</preartifactId>[[Category:Developer]] <version>1.0</version></dependency></syntaxhighlight>