Maven installation

From OpenKM Documentation
Jump to: navigation, search

Maven is a software tool for Java project management and build automation. It is similar in functionality to the Apache Ant tool, but is based on different concepts. Maven is hosted by the Apache Software Foundation, where it was formerly part of the Jakarta Project.

Maven uses a construct known as a Project Object Model (POM) to describe the software project being built, its dependencies on other external modules and components, and the build order. It comes with pre-defined targets for performing certain well defined tasks such as compilation of code and its packaging.

In GNU/Linux you can add the Maven executable to the binary path editing the $HOME/.bashrc file and adding this line at the end:

export PATH=$PATH:/path/to/maven/installation/bin
export MAVEN_OPTS="-Xmx512m"

Learn more about Maven at http://maven.apache.org.

Register missing Maven dependencies

Although project dependencies usually at located at Maven repositories, sometimes there are missing artifacts. So, we have to provide these libraries registering them in the local Maven repository. Follow these steps to register some libraries needed by OpenKM:

  • Open an operating system console.
  • Go to OpenKM project path in your local file system.
  • Drive into ext-libs and execute install.sh (Windows users simply open this file with text editor and execute the command)

Nota clasica.png Starting with OpenKM 5.0, you don't need to register manually these dependencies.

Some Maven tips

Download sources and javadoc from libraries dependency to improve the developer experience:

$ mvn install -DdownloadSources=true  -DdownloadJavadocs=true

You can make Maven ignore test failures in the build process this way:

$ mvn install -Dmaven.test.failure.ignore=true

If you would like to skip tests, you can do so by executing the following command:

$ mvn install -Dmaven.test.skip=true