gpt4 book ai didi

maven-2 - Maven 站点部署构建错误

转载 作者:行者123 更新时间:2023-12-02 11:57:34 25 4
gpt4 key购买 nike

当我最近在构建中运行“mvn install site-deploy”时,我不断收到以下错误。我不知道出了什么问题,因为我已经替换了 m2 repo 也尝试了几个干净的版本。有人可以给我一个提示,我可以在哪里找到解决方案吗?我尝试谷歌搜索但无法遇到一些相关的事情。谢谢。

 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

版本信息:jdk1.6.0_14,apache-maven-2.1.0

最佳答案

我们刚刚遇到了这个问题,尽管是使用 org.apache.felix:maven-bundle-plugin。

我们的问题源于我们没有在 pom.xml 中指定插件版本:

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

这一切都很好,一切都可以与(当时)最新版本的插件(即 2.3.4)配合使用。

但是,当外部 Maven 存储库(版本 2.3.5)上提供新版本的插件时,我们收到以下错误:

...
[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]
...

我们通过在 pom.xml 中明确声明插件的版本解决了这个问题:

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

希望这有帮助。

关于maven-2 - Maven 站点部署构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1913546/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com