Maven and its Eclipse plugin

/projects/general/MavenEclipse

Maven

Maven helps with project management generally, but especially, makes dependency management easier.

Installing Maven

See http://maven.apache.org/download.html

The Eclipse plugin

The Eclipse plugin makes it very easy to ensure your classpath is set up properly in Eclipse - right click and select 'Maven > Enable Dependency Management"

Once you've done that, those dependencies end up on the build path - you can see them on the "Libraries" tab.

Also, for a webapp like plutext-server, you can right click, Properties > J2EE Module Dependencies and tick Maven Dependencies to have them automatically put in WEB-INF/lib. Nice!

Get the Maven2 plugin for Eclipse from the update site at http://m2eclipse.sonatype.org/update/

BEWARE - If you have just installed Maven, before trying to do anything with the Maven2 plugin, make sure that Maven has created its .m2 directory. To do this, run Maven from a command prompt. For example, do "mvn install" from within the new project directory you just created in your workspace.

Tips and tricks

To print a dependency tree, you can use:

mvn dependency:tree

For example, see dependency tree for plutext-server

For this to work, the plutext-server pom specifies maven-dependency-plugin 2.0-SNAPSHOT

To resolve that, you need to follow the instructions at http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html to add http://people.apache.org/repo/m2-snapshot-repository