Creating a Maven Project that Depends on org.lcsim
Overview
This tutorial shows how to create a Maven-based project that depends on org.lcsim, so that your code can seemlessly access this framework and all of its dependencies.
The Maven tool is used to build the org.lcsim software. It automates most of the low-level details of involving dependencies and building for Java projectscompiling. For instance, it can automatically download external JARs required by your project required jar files based on a repository URL. Additionally, it can build a complete project website including source code metrics, cross-reference, and JavaDocs.
This tutorial shows how to create a Maven project that depends on org.lcsim, so that your code can seemlessly access this framework and all of its dependencies.
Tip | ||
---|---|---|
| ||
It is always a good idea to store your projects in a source control system, such as CVS. Contact your local system administrator for instructions on setting up a module for your project. |
Example Maven Project
If you want to get started quickly without worrying about the details, the SLAC CVS contains a sample Maven project called ExampleMavenProject that can be checked-out with this command.
...
The remaining portion of this tutorial covers how to make a Maven/org.lcsim project from scratch, in case you are wondering about the details.
Creation from Scratch
This section contains instructions for creating the Maven-based project from scratch using only the org.lcsim CVS module.
Tip | ||
---|---|---|
| ||
It is always a good idea to store your projects in a source control system, such as CVS. Contact your local system administrator for instructions on setting up a module for your project. |
Directory Setup
Create a directory for your new project and go into it.
...
No Format |
---|
mkdir -p test/org/lcsim |
Build Files
The project's root directory should contain three Maven configuration files.
...
The org.lcsim JAR is not currently maintained as a downloadable dependency. Each project user needs to compile and build this program themselves in order to install it to the local repository.
Basic Build Command
The project can be built from the command line with this simple command.
...
Alternately, you can use the Netbeans IDE to build your Maven-based projects.
Run Plugin
The FreeHep Run Plugin can generate a run script for your project.
...
The command line syntax of the script is completely up to you.
JAS
JAS3 can be configured to automatically load your project's classes on startup.
...
The class should now be available using the File -> Load command within JAS3.
Build Script
A full build command for your project, incorporating all of the above features, would look something like this.
...