[ https://jira.codehaus.org/browse/MNG-5783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Fedorenko closed MNG-5783. ------------------------------- Resolution: Fixed Maven 3.2.5 and earlier did not filter slf4j and javax.inject from plugin and build extension realms, which resulted in the same classes available from multiple classloaders and caused in hard to debug build failures in some cases. To fix that I've added slf4j and javax.inject to the list of artifacts exported by Maven core, which broke cobertura and probably other plugins that use ${plugin.artifacts} to setup classpath of external jvm and need slf4j. The solution is to move core artifact from plugin dependency resolver to class realm manager. This way ${plugin.artifacts} will include all plugin compile/runtime dependencies, but class realms will only include artifacts unique to the plugin. As a result of the fix some plugins will resolve additional artifact jars from remote repositories. This should not cause problems in practice because corresponding artifact poms are already resolved during the build. If this does cause problems, unwanted dependencies can be blocked both from consuming projects pom.xml using plugin <dependencies> elements, or, more permanently, by plugin developers by using scope=provided. Fix https://git-wip-us.apache.org/repos/asf?p=maven.git&a=search&h=HEAD&st=commit&s=MNG-5783 IT https://git1-us-west.apache.org/repos/asf?p=maven-integration-testing.git&a=search&h=HEAD&st=commit&s=MNG-5783 > cobertura-maven-plugin:instrument failing NoClassDefFoundError: > org/slf4j/LoggerFactory > --------------------------------------------------------------------------------------- > > Key: MNG-5783 > URL: https://jira.codehaus.org/browse/MNG-5783 > Project: Maven > Issue Type: Bug > Affects Versions: 3.3.0 > Reporter: Herve Boutemy > Assignee: Igor Fedorenko > Priority: Critical > Fix For: 3.3.0 > > Attachments: build-3.2.5.log, build-3.3.0-SNAPSHOT.log > > > testing cobertura-maven-plugin from svn > http://mojo.codehaus.org/cobertura-maven-plugin/ > IT pass with Maven 3.2.5 but fail with 3.3.0-SNAPSHOT > (not the same issue as MNG-5779) > {noformat}[DEBUG] /bin/sh -c /opt/jdk1.7.0_71/jre/bin/java > -Dlog4j.configuration=file:/tmp/log4j1560920244563737852config.properties > -Xmx1024m net.sourceforge.cobertura.instrument.InstrumentMain --commandsfile > /tmp/cobertura.4914644993417176752.cmdline > [DEBUG] exit code: 1 > [DEBUG] -------------------- > [DEBUG] Standard error from the Cobertura task: > [DEBUG] -------------------- > [ERROR] Exception in thread "main" java.lang.NoClassDefFoundError: > org/slf4j/LoggerFactory > at > net.sourceforge.cobertura.instrument.InstrumentMain$LoggerWrapper.<init>(InstrumentMain.java:165) > at > net.sourceforge.cobertura.instrument.InstrumentMain$LoggerWrapper.<init>(InstrumentMain.java:164) > at > net.sourceforge.cobertura.instrument.InstrumentMain.<clinit>(InstrumentMain.java:66) > Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory > at java.net.URLClassLoader$1.run(URLClassLoader.java:366) > at java.net.URLClassLoader$1.run(URLClassLoader.java:355) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:354) > at java.lang.ClassLoader.loadClass(ClassLoader.java:425) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) > at java.lang.ClassLoader.loadClass(ClassLoader.java:358) > ... 3 more > {noformat} -- This message was sent by Atlassian JIRA (v6.1.6#6162)