...
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. |
Easy Way
The SLAC LCD cvs contains a sample Maven project called ExampleMavenProject, which can be checked out with this command.
No Format |
---|
cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcd co ExampleMavenProject
|
To build it 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.
No Format |
---|
ExampleMavenProject - Hello world!
|
The class run by the project script is specified in the project.properties file.
No Format |
---|
maven.jar.mainclass=ExampleMavenProject
|
So the script executes the main() method of the class found in src/ExampleMavenProject.
Now you are ready to experiment with your own Maven project.
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.
Directory Setup
Create a directory for your project and go into it.
...