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.
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.
cd ExampleMavenProject ./build.sh
Or you can use Maven directly.
maven -Drun.install=$(pwd) -Dmaven.test.skip=true clean jar:install jas:install run:install
Now, test it by running the automatically generated script.
./bin/ExampleMavenProject
It should print this message.
ExampleMavenProject - Hello world!
Now you can add Java into src or test. Classes placed here should be able to access the org.lcsim framework and its dependencies. Simply rerun the above build command to compile the new classes.
To use ExampleMavenProject as a template for your own new project, replace the "ExampleMavenProject" string with the actual name of your own project in project.xml.
The remainder of this tutorial shows how to create a Maven/org.lcsim project from scratch, in case you are wondering about the details.