Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven site-deploy build error

Tags:

maven-2

When I run "mvn install site-deploy" lately in the build I get the following error continuously. I cannot figure out what's wrong as I've replaced the m2 repo also tried several clean builds. Could somebody give me a hint where I can find a solution. I tried googling but could not come across something relevant. Thanks.

 FATAL ERROR] org.apache.maven.plugins.site.SiteMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the realms:
[FATAL ERROR] Plugin realm = app0.child-container[org.apache.maven.plugins:maven-site-plugin:2.0-beta-7]
......
[FATAL ERROR] Container realm = plexus.core
.......
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org/apache/maven/plugin/logging/Log
org.apache.maven.plugin.logging.Log
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/maven/plugin/logging/Log
    at org.codehaus.mojo.emma.EmmaReportMojo.canGenerateReport(EmmaReportMojo.java:319)
    at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.filterReports(AbstractSiteRenderingMojo.java:177)
    at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:81)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
    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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.ClassNotFoundException: org.apache.maven.plugin.logging.Log
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
    at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
    at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 21 more

Version Information: jdk1.6.0_14,apache-maven-2.1.0

like image 953
sanjayav Avatar asked Dec 16 '09 09:12

sanjayav


2 Answers

We have just run into this very problem albeit with the org.apache.felix:maven-bundle-plugin.

Our problem stemmed from the fact that we did not specify a plugin version within the pom.xml:

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
</plugin>

This was all well and good and everything worked with the (then) latest version of the plugin i.e. 2.3.4.

However, when a new version of the plugin became available on the external Maven repository (version 2.3.5) we got the following error:

...
[FATAL ERROR] org.apache.felix.bundleplugin.BundlePlugin#execute() caused a linkage error (java.lang.NoSuchMethodError) and may be out-of-date. Check the realms:
[FATAL ERROR] Plugin realm = app0.child-container[org.apache.felix:maven-bundle-plugin:2.3.5]
...

We resolved this issue by explicitly stating the version of the plugin within our pom.xml:

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>2.3.4</version>
</plugin>

Hope this helps.

like image 67
ryan Avatar answered Sep 28 '22 05:09

ryan


I see that you are using Emma report. Maybe it a problem with dependencies in this plugin. Missing class should be in maven-plugin-api artifact.

Try first to comment out Emma report, if that helps try use antoher version of this plugin or fixing it by adding appropriate dependency in your pom - in your case maven-plugin-api.

like image 28
cetnar Avatar answered Sep 28 '22 06:09

cetnar