Installation¶
Use Maven Central Binaries¶
Note
This is the recommended way of installing for normal users.
Simply use the following snippet for your pom.xml
for using OntoLib modules in your Maven project.
<dependencies>
<dependency>
<groupId>com.github.phenomics</groupId>
<artifactId>ontolib-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.phenomics</groupId>
<artifactId>ontolib-io</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Install from Source¶
Note
You only need to install from source if you want to develop OntoLib in Java yourself.
Prequisites¶
For building OntoLib, you will need
- Java JDK 8 or higher for compiling OntoLib,
- Maven 3 for building OntoLib, and
- Git for getting the sources.
Git Checkout¶
In this tutorial, we will download the OntoLib sources and build them in ~/Development/ontolib
.
~ # mkdir -p ~/Development
~ # cd ~/Development
Development # git clone https://github.com/phenomics/ontolib.git ontolib
Development # cd ontolib
Maven Proxy Settings¶
If you are behind a proxy, you will get problems with Maven downloading dependencies.
If you run into problems, make sure to also delete ~/.m2/repository
.
Then, execute the following commands to fill ~/.m2/settings.xml
.
ontolib # mkdir -p ~/.m2
ontolib # test -f ~/.m2/settings.xml || cat >~/.m2/settings.xml <<END
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>8080</port>
<nonProxyHosts>*.example.com</nonProxyHosts>
</proxy>
</proxies>
</settings>
END
Building¶
You can build OntoLib using mvn package
.
This will automatically download all dependencies, build OntoLib, and run all tests.
ontolib # mvn package
In case that you have non-compiling test, you can use the -DskipTests=true parameter for skipping them.
ontolib # mvn install -DskipTests=true
Creating Eclipse Projects¶
Maven can be used to generate Eclipse projects that can be imported by the Eclipse IDE.
This can be done calling mvn eclipse:eclipse
command after calling mvn install
:
ontolib # mvn install
ontolib # mvn eclipse:eclipse