You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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
    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:

ln -s pom2.xml pom.xml

You can now build org.lcsim with maven2.

mvn

If you want to skip the tests, use

mvn -Dmaven.test.skip=true
Eclipse integration

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

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

You will have to restart Eclipse after running this command.

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

mvn eclipse:clean
mvn eclipse:eclipse

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:

 ln -s ~/.m2 ~/m2 

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.7. Please follow the installation instructions on the web page for the plug-in.

After installing the plug-in, you are now able to build org.lcsim from within Eclipse.

Building a new project

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.

  • No labels