views:

946

answers:

1

I am trying to find a simple single purpose plugin that will maintain the Eclipse classpath based on the Maven2 POM dependencies.

I know about m2eclipse and q4e. Unfortunately, I'm currently using RAD (Rational Application Developer - IBM's commercial version of Eclipse) and it is not fully compatible with m2eclipse, and I can't use q4e as I'm using Maven 2.0.7 with no way to upgrade to 2.1.

I'm almost to the point where I write my own container plugin (probably based on some m2eclipse source :-)) but there would be a lot of mucking about with resolving transitive and parent dependencies so hopefully someone has already done it...

A: 

No better answer so I did end up writing my own plugin. Works nicely :-)

Basically I parse the pom.xml in the project, this gives me the parent (if any) and dependencies. I then look them up and recursively do the same thing to generate the complete list of jars to be added to the container.

There is a lot of hacky mucking about with properties and dependency management, and our "team" repository is corrupted with a mixture of Maven 1 and Maven 2 poms (plus other stuff) so I strip off the Maven 2 namespace so I can treat the xml the same (in a happy coincidence that also means I can use simple xpath queries :-)).

Rich, I can send you the code but it is a major hack. I've been thinking I should rebuild it to make use of the output from dependency:list and/or dependency:tree, but I'd probably need to clean up the repository first.

Michael Rutherfurd
can you post some pointers to your implementation?
Rich Seller