[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [m2e-dev] m2e 1.4.0 strance classloader bug
|
Sounds like bug 422106 [1], see if m2e 1.5 M6 or latest snapshot work
better.
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=422106
--
Regards,
Igor
On 2014-04-08, 13:21, Grzegorz Słowikowski wrote:
Hi
I found strange classloader bug testing my plugin with M2Eclipse.
My mojo uses plexus-utils DirectoryScanner class. Plexus-utils
dependency version is "3.0.17".
When my mojo executes I have this exception:
Description Resource Path Location Type
Execution default-routes-compile of goal
com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha6-SNAPSHOT:routes-compile
failed: An API incompatibility was encountered while executing
com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha6-SNAPSHOT:routes-compile:
java.lang.NoSuchMethodError:
org.codehaus.plexus.util.DirectoryScanner.setupMatchPatterns()V
-----------------------------------------------------
realm =
plugin>com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha6-SNAPSHOT
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] =
file:/d:/home/gs/.m2/repository/com/google/code/play2-maven-plugin/play2-maven-plugin/1.0.0-alpha6-SNAPSHOT/play2-maven-plugin-1.0.0-alpha6-SNAPSHOT.jar
urls[1] =
file:/d:/home/gs/.m2/repository/com/google/code/play2-maven-plugin/play2-provider-api/1.0.0-alpha6-SNAPSHOT/play2-provider-api-1.0.0-alpha6-SNAPSHOT.jar
urls[2] =
file:/d:/home/gs/.m2/repository/org/apache/ant/ant/1.9.0/ant-1.9.0.jar
urls[3] =
file:/d:/home/gs/.m2/repository/org/apache/ant/ant-launcher/1.9.0/ant-launcher-1.9.0.jar
urls[4] =
file:/d:/home/gs/.m2/repository/com/typesafe/config/1.2.0/config-1.2.0.jar
urls[5] =
file:/d:/home/gs/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
urls[6] =
file:/d:/home/gs/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
urls[7] = file:/d:/home/gs/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[8] =
file:/d:/home/gs/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
urls[9] =
file:/d:/home/gs/.m2/repository/org/codehaus/plexus/plexus-archiver/2.3/plexus-archiver-2.3.jar
urls[10] =
file:/d:/home/gs/.m2/repository/org/codehaus/plexus/plexus-io/2.0.6/plexus-io-2.0.6.jar
urls[11] =
file:/d:/home/gs/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.17/plexus-utils-3.0.17.jar
Number of foreign imports: 4
import: Entry[import org.sonatype.plexus.build.incremental from realm
ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.Scanner from realm
ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.AbstractScanner from realm
ClassRealm[plexus.core, parent: null]]
import: Entry[import from realm
ClassRealm[project>com.google.code.play2-maven-plugin.test-projects.play22.scala:helloworld:1.0.0-alpha6-SNAPSHOT,
parent: ClassRealm[maven.api, parent: null]]]
-----------------------------------------------------
(com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha6-SNAPSHOT:routes-compile:default-routes-compile:generate-sources)
pom.xml /helloworld-1.0.0-alpha6-SNAPSHOT line 90 Maven Build
Problem
I found the reason, but don't know what is the proper path to solve this.
The reason is "org.codehaus.plexus.util.DirectoryScanner" class is
loaded by
ClassRealm[plugin>com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha6-SNAPSHOT,
parent: sun.misc.Launcher$AppClassLoader@aa4c7c]
and it's base class "org.codehaus.plexus.util.AbstractScanner" is loaded by
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@107a705[org.eclipse.m2e.maven.runtime:1.4.0.20130531-2315(id=195)]
M2Eclipse bundled version is 2.0.6.
When I call DirectoryScanner.scan(), it calls "setupMatchPatterns()"
method. This method was introduced in AbstractScanner class in
plexus-utils version 3.0.5
so it's not there in version 2.0.6.
If I downgrade "plexus-utils" dependency version in my plugin's pom.xml,
it works, but I don't like this solution. Is there any better? Or maybe
this problem has been
already solved.
You can reproduce this problem for example by importing
https://play2-maven-plugin.googlecode.com/svn/trunk/test-projects/play22/scala/helloworld
example project.
My Maven plugin's sources are here:
https://play2-maven-plugin.googlecode.com/svn/trunk/plugin/play2-maven-plugin
The first mojo executed in M2Eclipse configuration build is:
http://play2-maven-plugin.googlecode.com/svn/trunk/plugin/play2-maven-plugin/src/main/java/com/google/code/play2/plugin/Play2RoutesCompileMojo.java
(it uses DirectoryScanner).
Thanks in advance.
Grzegorz Slowikowski
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev