Code documentation
Development Tools
Code Structure
Techniques and Standards
Help and Web Site
How To
Functional Info
Background Info

JMRI Help:

Contents Index
Glossary FAQ

Donate to JMRI.org

JMRI Code: Building with Command Line Tools

Those of you who prefer a command line approach might want to investigate ant and maven, build utilities for Java projects. In the JMRI devlopment ecosystem, these two tools complement each other, each providing unique capabilities the other tool does not.

Ant

You computer may already have Ant installed as part of a developer tools package. Try ant -version to check. JMRI requires at least version 1.10.6, and should work with any version after that.

If you need to install it, Ant is available for download at https://ant.apache.org/ or via the usual package managers.

To make sure everything is working, before you e.g. commit your code back, please do:

ant clean alltest

and make sure the tests run cleanly.

A new JMRI checkout should build cleanly. If not, please check with the JMRIusers or jmri-developers mailings lists for help.

Maven

Maven is an extensible plugin-based build tool for Java development. Maven is available for download at https://maven.apache.org/. Maven will download the appropriate plugins and dependencies as needed. After installation, the following can be done from your JMRI working copy (see Getting the Code for instructions on creating a working copy):
Run unit and integration tests
mvn test
Use mvn test -Dtest=PATTERN to run specific tests. See Running a Single Test for more details, including running only a single test method. An example to run all tests in a package is mvn test -Dtest=jmri/jmrix/openlcb/**
Check for vulnerabilities in JMRI dependencies
mvn compile net.ossindex:ossindex-maven-plugin:audit
Check for newer versions of JMRI dependencies
mvn versions:display-dependency-updates
Check for newer versions of the maven plugins
mvn versions:display-plugin-updates
Run DecoderPro
mvn antrun:run -Danttarget=decoderpro
Run PanelPro
mvn antrun:run -Danttarget=panelpro

The scripts/mvn-test includes all the options necessary to run the Travis CI test Maven job from your local command line.