开发者

Maven site-deploy build error

开发者 https://www.devze.com 2022-12-13 23:42 出处:网络
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

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


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.


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.


First, if possible then use the latest version of Maven (2.2.1), its super pom will properly contain new versions that might solve your problem. Then try forcing a plugin update using -cpu i.e:

mvn -cpu site

If you are using snapshots then also add -U. Finally if you freeze the plugin versions in your project, then try updating them. If all else fails then take a look at the effective pom (mvn help:effective-pom) to see what versions are bing used, then google for bugs


This should work with Maven 2.1.0 (even if upgrading would be a good idea). Try to use a more recent version of the plugin in your POM by explicitly setting the version (you should use fixed version anyway):

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.0.1</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>
0

精彩评论

暂无评论...
验证码 换一张
取 消