Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Warning
titleTHIS PAGE IS OUT OF DATE.

The information on this page is no longer accurate, as lcsim-based projects have switched to using maven 2.

While there are currently no equivalent instructions for maven 2, please refer to the lcsim-contrib project
in the SLAC CVS for an example of an m2 project that depends on lcsim.

Creating a Maven Project that Depends on org.lcsim

...

The Maven tool is used to build the org.lcsim software. It automates the low-level details involving dependencies and compiling. For instance, it can automatically download required jar files based on a repository URL. Additionally, it can build a complete project website including source code metrics, cross-reference, and JavaDocs.

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.

No Format

cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcd co ExampleMavenProject

This project is "ready to go" and can be used as a template.

To build the example project from the command-line, assuming there is an sh shell available, e.g. on Linux, Cygwin, etc.

No Format

cd ExampleMavenProject
./build.sh

Or you can use Maven directly.

No Format

maven -Drun.install=$(pwd) -Dmaven.test.skip=true clean jar:install jas:install run:install

Now, test it by running the automatically generated script.

No Format

./bin/ExampleMavenProject

It should print this message.

Now you are ready to experiment with your own Maven project. Any Java code placed into src or test should be able to access all the classes of the org.lcsim framework and its dependencies.

To use the example project as a template, simply replace the "ExampleMavenProject" string with the actual name of your own project in project.xml.

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
titleSource Control

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.

...

Alternately, you can use the Netbeans IDE to build your Maven-based projects.

...