Maven can be used as the build system for your project. org.lcsim uses this tool
for its build. This tool handles most (if not all) of the low-level details of
dependencies and building.
The dependent project's root directory should contain three configuration files
for Maven.
All of these files can be copied from org.lcsim's root directory.
In the dependent project's project.xml file, the following should be inserted to make it depend
on org.lcsim, itself.
<dependency> <groupId>lcsim</groupId> <artifactId>lcsim</artifactId> <version>0.9</version> <url>http://www.lcsim.org</url> </dependency> |
org.lcsim is not maintained as a downloadable JAR file. Each project user should compile and
build this program themselves.
Source code should be put into a src/ directory. Probably the directory path for source code should be org/lcsim,.
Once the above steps are performed, typing maven should build the project into the target/ directory.
The FreeHep Run Plugin can generate a run script for your project.
To enable this functionality, insert the following into the project.xml file.
<dependency> <groupId>freehep</groupId> <artifactId>freehep-run-plugin</artifactId> <version>1.1.1</version> <url>http://java.freehep.org/maven/freehep/plugins</url> <type>plugin</type> </dependency> |
Maven also needs to know what class to be executed. This goes into the project.properties file.
maven.jar.mainclass=my.classpath.myMain |
To build the script, execute the following target.
maven -Drun.install=$(pwd) run:install |
A run script named after your project should now be placed into the bin directory.
This target will copy the project's JAR into JAS3's extensions directory at ~/.JAS3/extensions.
maven jas:install |
The version number will be stripped out of the JAR name, and any existing JAR by the same name will be overwritten.
A full build command for your project could be something like this.
maven -Dmaven.test.skip=true -Drun.install=$(pwd) clean jar:install jas:install run:install |
This will do a clean build, skipping tests and installing the run script to the current directory.
It also puts the JAR files into the ~/maven/repository area and ~/.JAS3/extensions.