There are several issues.

First of all you need to explicitly declare dependency on tools.jar in your project poms. See Maven FAQ entry about this at
 http://maven.apache.org/general.html#tools-jar-dependency

Unfortunately that won't resolve issue with your projects in m2eclipse. We have to use embedded Maven version [1] and apparently there is a regression that is affecting class loading from the tools.jar. I been able to reproduce the same error from the command line with Maven 2.1-SNAPSHOT used in m2eclipse, as well as with latest Maven version from trunk.

I'd suggest to open JIRA issue to Maven project and attach your test projects up there. See http://jira.codehaus.org/browse/MNG

 regards,
 Eugene

[1] http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ#ProjectFAQ-WhatMavenversionisusedbyplugin


Yann wrote:
Hi,

If a Maven plugin uses classes from ${java.home}/lib/tools.jar
for instance : com.sun.mirror.apt.AnnotationProcessorFactory

and if a maven project use this plugin (with phase=generate-sources) then I get the following error:

13.08.08 19:56:32 CEST: [FATAL ERROR] org.test.simplePlugin.MyMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError).


I get this behaviour when I import the project or when I Update Project Configuration.
And in maven commande line I don't have this issue.


I typically get this error with the maven-jaxb-schemagen-plugin but I created also a simple test case.

Do you have an idea why this class is not found?
Thanks
Yann.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to