Wiki

Clone wiki

Nuclear_Morphology / Building_from_source

Building NMA from source

Prerequisites

If you want to build the software from source code yourself, you should be somewhat familiar with Maven projects. You will require JDK 16 or higher.

The full build also requires the following programs on the PATH:

One of the dependencies in the POM - jebl - is not available via Maven Central, and is downloaded and installed to your local Maven repository during the initialize phase of the Maven lifecycle using the scripts/installDependencies script. If you have a non-standard path for your Maven repository, you may need to adjust the script or install the dependency manually as described below.

To manually install jebl: download it from the link below:

Dependency Version Used for External link
jebl 0.4 Displaying dendrograms from hierarchical clustering https://sourceforge.net/projects/jebl/

To add the jebl jar to your Maven repository, adapt this sample command with your own directory paths:

mvn install:install-file -Dfile="/path/to/jebl-0.4.jar" -DgroupId=jebl -DartifactId=jebl -Dversion=0.4 -Dpackaging=jar

Build process

The full Maven build of NMA performs the following steps:

  • shell scripts for packaging and rendering are created from templates/, adding version-specific strings, and output to scripts/
  • Java classes are compiled
  • sample datasets are created from test images
  • the UI is launched and screenshots are taken for inclusion in the user guide
  • unit tests are run
  • the user guide is rendered from an R-markdown template by running the scripts/renderUserGuide script
  • a runnable standalone jar file is created (output to target/standalone/)
  • in Windows and Linux, the jar file is packaged with a Java runtime by running the scripts/packageAppImage script (output to target/appimage/)
  • in Windows and Linux, a zip file of the portable appimage is created (output to target/)
  • in Windows, an MSI installer is created (output to target/)

Run mvn install to run this full process. To build without running the screenshotting or test suite, run mvn install -DskipTests.

Run mvn test to run the screenshotting and test suite alone.

If you get an error similar to:

[ERROR] Failed to execute goal on project nma: Could not resolve dependencies for project com.bmskinner:nma:jar:2.0.0: Could not find artifact jebl:jebl:jar:0.4 in jitpack.io (https://jitpack.io) -
the jebl dependency was not installed in your local Maven repository. Note that if you are using an IDE, it may be using a separate Maven repository from the system repository.

In MacOs, the full build process has not been tested; all steps up to jar creation should complete, outputting a runnable jar file to target/standalone/. A sample packaging script has been provided based on the jpackage documentation to generate a DMG installer (templates/packageDMG.sh), but has not been tested.

Contributing

If you have ideas for improving NMA, you are very welcome to contribute - either raise an issue in the issue tracker, or get in touch with me to discuss further (https://www.essex.ac.uk/people/skinn19306/benjamin-skinner). At present there is no formal process to bring new coders into the project since I'm the only person working on NMA.

Full dependency list

These are the other dependencies from the POM and their reason for inclusion. For exact versions, see the POM directly.

Dependency (groupId.artifactId) Used for
com.github.lejon.T-SNE-Java Creating t-SNEs
com.github.ijpb.MorphoLibJ Morphological image operators
net.imagej.ij Core ImageJ functions
org.apache.commons.commons-math3 Core mathematical operators
org.eclipse.jdt.annotation Java class annotations
org.swinglabs.swingx.swingx-al TreeTable used in datasets panel
nz.ac.waikato.cms.weka.weka-stable Clustering methods
org.jfree.jfreechart Charting library
org.jfee.svg SVG exports
junit.junit Unit testing
org.assertj.assertj-swing-junit Unit testing
org.mockito.mockito-core Unit testing
org.jdom.jdom2 XML parsing
net.sf.doolin.javadocking Dockable tab interface
org.hamcrest.hamcrest.core Unit testing
com.google.code.gson.gson JSON parser
org.apache.maven.plugins.maven-jar-plugin Creating runnable jars
org.apache.xmlgraphics.batik-transcoder Creating export PNGs at arbitrary resolution
org.apache.xmlgraphics.batik-codec PNG transcoding

Updated