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

We are starting to have support for maven 2 for building org.lcsim.
This is a cheat sheet for building org.lcsim with maven 2.

Prerequisites

  • Maven 2
  • GeomConverter
  • org.lcsim
    Once you have downloaded maven and put the directory where you want it, make sure the executable mvn is in your $PATH. Then you are done with the installation of maven2.

Command line

The proper command to run maven2 is "mvn". Before building the org.lcsim libraries with it, you have to create a symbolic link from pom2.xml to pom.xml in the main directory of org.lcsim. In Unix derivates you would go about it like this:

...

You can now build org.lcsim with maven2.

Code Block

mvn

If you want to skip the tests, use

Code Block

mvn -Dmaven.test.skip=true
Info

Note that Maven 2 also automatically updates the JAS3 plugins

Eclipse integration

First, we have to inform Eclipse where to find the maven repository.

Code Block
mvn -Declipse.workspace=<eclipse workspace dir> eclipse:add-maven-repo

You will have to restart Eclipse after running this commandcreate a new project with the existing sources for GeomConverter and lcsim. If you have checked out the two projects from cvs, Eclipse will recognize that, so that you have all the cvs commands available within the IDE.

Next, make sure that org.lcsim builds. When building and testing has finished, issue

...

This will download all dependencies and put the correct paths into the Eclipse .project file. Upon refreshing the project, you should now have code completion working.

...

It appears that Eclipse has some problems with the default maven2 repository location ~/.m2/repository. One workaround is to create a symbolic link that does not contain leading dots and change the value of the M2_REPO Classpath variable to the new location.
Example:

...

and then change the value of "Preferences->Java->Build Path->Classpath Variables"

Eclipse plug-in

Plug-ins for Eclipse are available from the Maven2 homepage. We have tested the Q plug-in and can confirm it works with maven 2.0.79. Please follow the installation instructions on the web page for the plug-in.

...

If you now create a new project, have it depend on the lcsim project in Eclipse. In the properties of the lcsim project, in the build path settings, export the dependencies of the lcsim project, so that they are automatically passed down to the new dependent project. Then code completion should also work in the new project that you just created.

Troubleshooting

If everything is screwed up in eclipse (e.g. your programs don't compile any more because of some dependency problems) try:

Code Block

mvn eclipse:clean
mvn eclipse:eclipse

 in the directory where you have installed lcsim.