Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: 2.2.0
-
Fix Version/s: 2.2.0
-
Labels:None
-
Number of attachments :0
Description
Just upgraded guvnor locally to gwt 2.2.0 and gwt-maven-plugin 2.2.0 and I get this error:
A required class is missing: org/codehaus/plexus/util/xml/XmlStreamReader
Since 2.2.0 is just been released, I suspect the 2.2.0 release might be broken?
to reproduce:
git clone git@github.com:droolsjbpm/droolsjbpm-build-bootstrap.git droolsjbpm-build-bootstrap
cd droolsjbpm-build-bootstrap
gedit pom.xml // adjust gwt.version
mvn clean install
cd ..
git clone git@github.com:droolsjbpm/guvnor.git guvnor
cd guvnor
gedit pom.xml // adjust gwt-maven-plugin version
mvn clean install -DskipTests
and you get:
[INFO] Guvnor web application ............................ FAILURE [4.641s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.647s
[INFO] Finished at: Wed Mar 02 14:42:24 CET 2011
[INFO] Final Memory: 12M/297M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.2.0:compile (default) on project guvnor-webapp: Execution default of goal org.codehaus.mojo:gwt-maven-plugin:2.2.0:compile failed: Unable to load the mojo 'compile' in the plugin 'org.codehaus.mojo:gwt-maven-plugin:2.2.0'. A required class is missing: org/codehaus/plexus/util/xml/XmlStreamReader
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:gwt-maven-plugin:2.2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/gdesmet/.m2/repository/org/codehaus/mojo/gwt-maven-plugin/2.2.0/gwt-maven-plugin-2.2.0.jar
[ERROR] urls[1] = file:/home/gdesmet/.m2/repository/com/google/gwt/gwt-servlet/2.2.0/gwt-servlet-2.2.0.jar
[ERROR] urls[2] = file:/home/gdesmet/.m2/repository/com/google/gwt/gwt-user/2.2.0/gwt-user-2.2.0.jar
[ERROR] urls[3] = file:/home/gdesmet/.m2/repository/com/google/gwt/gwt-dev/2.2.0/gwt-dev-2.2.0.jar
[ERROR] urls[4] = file:/home/gdesmet/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>org.droolsjbpm:guvnor:5.2.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
Activity
I tried to reproduce your issue, works for me
(
Apache Maven 3.0.2 (r1056850; 2011-01-09 01:58:10+0100)
Java version: 1.6.0_22, vendor: Apple Inc.
OS name: "mac os x", version: "10.6.6", arch: "x86_64", family: "mac"
)
Are you running under IC server ? @aheritier encoutered same issue with jenknins.
No, I am just running locally. I 'll upgrade my maven version to 3.0.3 and see if it occurs again.
Reproduced with maven 3.0.3.
@Nicolas: did you use our code of github.com:droolsjbpm (see reproduce recipe above)?
We don't have any special plexus related dependency overwrites.
Other plugins shouldn't affect the classpath of the GWT plugin in maven 3: not sure what's going on.
On the GWT plugin, we overwrite the GWT dependencies to ensure the GWT version, but even commenting <dependencies> out still results in this error.
Full error:
[INFO] — gwt-maven-plugin:2.2.0:compile (default) @ guvnor-webapp —
8-mrt-2011 10:49:44 org.sonatype.guice.bean.reflect.LoadedClass
WARNING: Error injecting: org.codehaus.mojo.gwt.shell.CompileMojo
java.lang.NoClassDefFoundError: org/codehaus/plexus/util/xml/XmlStreamReader
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:628)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:835)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:769)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:254)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:843)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:957)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:990)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:951)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.util.xml.XmlStreamReader
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 47 more
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Guvnor multiproject ............................... SUCCESS [0.239s]
[INFO] Guvnor repository connector multiproject .......... SUCCESS [0.023s]
[INFO] Guvnor repository connector JCR ................... SUCCESS [0.883s]
[INFO] Guvnor repository connector Jackrabbit ............ SUCCESS [0.563s]
[INFO] Guvnor repository connector ModeShape ............. SUCCESS [0.581s]
[INFO] Guvnor repository ................................. SUCCESS [1.965s]
[INFO] Drools jBPM IDE common ............................ SUCCESS [2.989s]
[INFO] Guvnor web application ............................ FAILURE [4.704s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.823s
[INFO] Finished at: Tue Mar 08 10:49:44 CET 2011
[INFO] Final Memory: 13M/291M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.2.0:compile (default) on project guvnor-webapp: Execution default of goal org.codehaus.mojo:gwt-maven-plugin:2.2.0:compile failed: Unable to load the mojo 'compile' in the plugin 'org.codehaus.mojo:gwt-maven-plugin:2.2.0'. A required class is missing: org/codehaus/plexus/util/xml/XmlStreamReader
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:gwt-maven-plugin:2.2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/gdesmet/.m2/repository/org/codehaus/mojo/gwt-maven-plugin/2.2.0/gwt-maven-plugin-2.2.0.jar
[ERROR] urls[1] = file:/home/gdesmet/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>org.droolsjbpm:guvnor:5.2.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.util.xml.XmlStreamReader
The PluginContainerException can have 3 causes (according to https://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException ):
1. The JAR or POM of the plugin or any of its dependencies got corrupted while being downloaded from the plugin repository to your local repository. For instance, if the plugin class path is missing some dependencies of the plugin, this can result in linkage errors that prevent the instantiation of the goal.
=> I removed the plugin from my local repository to trigger a new download => same problem.
2. You specified custom dependencies for the plugin in your POM which are not compatible with the plugin.
=> Where in the pom? Removing those in the <dependencies> of the plugin doesn't make a difference.
3. The plugin was not properly assembled by its creator.
Yes, I used your code form git and had no error
The error is to relate to missing classes from plexus-utils, but I have no idea what could be wrong
Can you purge your local repo from any plexus-utils ?
rm -Rf ~/.m2/repository/plexus
rm -Rf ~/.m2/repository/org/codehaus/plexus
did NOT fix it.
One more theory could be that the jboss mirror contains a corrupted jar, but that's not if I read the log correctly:
$ mvn clean install -DskipTests
...
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom (3 KB at 8.1 KB/sec)
...
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.0.3/plexus-utils-2.0.3.pom
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/2.0.3/plexus-utils-2.0.3.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/2.0.3/plexus-utils-2.0.3.pom (4 KB at 5.8 KB/sec)
...
There is something really odd. The error says:
... A required class is missing: org/codehaus/plexus/util/xml/XmlStreamReader [ERROR] urls[0] = file:/home/gdesmet/.m2/repository/org/codehaus/mojo/gwt-maven-plugin/2.2.0/gwt-maven-plugin-2.2.0.jar [ERROR] urls[1] = file:/home/gdesmet/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
So it using org.codehaus.plexus:plexus-utils:1.1 for the gwt-maven-plugin.
But http://repo1.maven.org/maven2/org/codehaus/mojo/gwt-maven-plugin/2.2.0/gwt-maven-plugin-2.2.0.pom
clearly states that it should use org.codehaus.plexus:plexus-utils:2.0.5
However, my local repository pom and the one on the jboss repo
http://repository.jboss.org/nexus/content/groups/public/org/codehaus/mojo/gwt-maven-plugin/2.2.0/gwt-maven-plugin-2.2.0.pom
contains:
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.2.0</version>
<packaging>maven-plugin</packaging>
<description>POM was created by Sonatype Nexus</description>
</project>
So that's my problem. You had the correct one installed in your local repo, so it never downloaded the wrong one from the jboss nexus instance. Not sure why Nexus decided to generate the GWT mojo plugin pom instead of download it or failing-fast as it should.
IMHO It's a real pain to have such artifacts deployed in the jboss repo
As some users add this repo in their settings/poms to get hibernate artifacts.
Due to this there is a lot of build breaks !!
http://repository.jboss.org/nexus/content/groups/public/org/codehaus/mojo/gwt-maven-plugin/2.2.0/gwt-maven-plugin-2.2.0.pom?describe
responseUid":"thirdparty-uploads:/org/codehaus/mojo/gwt-maven-plugin/2.2.0/gwt-maven-plugin-2.2.0.pom
@Oliver I agree. I 've notified Paul Gier and John Casey (our internal Red Hat maven experts).
They 'll probably clear the jboss nexus cache soon, but that still means that all people that have already downloaded it from there will need to clear their local repository. I believe this might be a bug in Nexus (we're running 1.7.1).
@Arnaud What does that URL mean? Did someone manually upload that pom and/or it's jar?
Makes sense. Is there anyway we can find out who did the upload and when? If we can't notify that person, there's a chance he/she does it again.
Paul's blog post send to the jboss developers to avoid that this happens again:
http://community.jboss.org/en/build/blog/2011/03/09/quick-guidelines-for-uploading-artifacts
maven 3.0.1, jdk 1.6u24, linux