欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mvn site 报错解决

程序员文章站 2022-07-15 12:53:29
...

问题描述

$mvn site

执行报错,错误描述如下:

$ mvn site
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building order-center 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-site-plugin:3.3:site (default-site) @ order-center ---
[WARNING] Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version.
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:3.0.0
[WARNING] Error injecting: org.apache.maven.report.projectinfo.CiManagementReport
java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
    at java.lang.Class.getDeclaredConstructors(Class.java:2020)
    at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
    at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
    at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
    at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006)
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038)
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
    at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
    at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:519)
    at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.getConfiguredMavenReport(DefaultMavenReportExecutor.java:306)
    at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildReportPlugin(DefaultMavenReportExecutor.java:263)
    at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports(DefaultMavenReportExecutor.java:154)
    at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getReports(AbstractSiteRenderingMojo.java:235)
    at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:121)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
    ... 59 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.819 s
[INFO] Finished at: 2018-12-14T13:13:30+08:00
[INFO] Final Memory: 19M/313M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project order-center: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: A required class was missing while executing org.apache.maven.plugins:maven-site-plugin:3.3:site: org/apache/maven/doxia/siterenderer/DocumentContent
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-site-plugin:3.3
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.jar
[ERROR] urls[1] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/reporting/maven-reporting-exec/1.1/maven-reporting-exec-1.1.jar
[ERROR] urls[2] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
[ERROR] urls[3] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/shared/maven-shared-utils/0.3/maven-shared-utils-0.3.jar
[ERROR] urls[4] = file:/Volumes/ssd/dev/tools/maven/repo/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[5] = file:/Volumes/ssd/dev/tools/maven/repo/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/Volumes/ssd/dev/tools/maven/repo/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[7] = file:/Volumes/ssd/dev/tools/maven/repo/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[8] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.jar
[ERROR] urls[9] = file:/Volumes/ssd/dev/tools/maven/repo/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[10] = file:/Volumes/ssd/dev/tools/maven/repo/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[11] = file:/Volumes/ssd/dev/tools/maven/repo/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[12] = file:/Volumes/ssd/dev/tools/maven/repo/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[13] = file:/Volumes/ssd/dev/tools/maven/repo/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[14] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar
[ERROR] urls[15] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-sink-api/1.4/doxia-sink-api-1.4.jar
[ERROR] urls[16] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-logging-api/1.4/doxia-logging-api-1.4.jar
[ERROR] urls[17] = file:/Volumes/ssd/dev/tools/maven/repo/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[18] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-core/1.4/doxia-core-1.4.jar
[ERROR] urls[19] = file:/Volumes/ssd/dev/tools/maven/repo/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
[ERROR] urls[20] = file:/Volumes/ssd/dev/tools/maven/repo/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
[ERROR] urls[21] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.jar
[ERROR] urls[22] = file:/Volumes/ssd/dev/tools/maven/repo/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
[ERROR] urls[23] = file:/Volumes/ssd/dev/tools/maven/repo/commons-codec/commons-codec/1.3/commons-codec-1.3.jar
[ERROR] urls[24] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar
[ERROR] urls[25] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-module-xhtml/1.4/doxia-module-xhtml-1.4.jar
[ERROR] urls[26] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-module-apt/1.4/doxia-module-apt-1.4.jar
[ERROR] urls[27] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-module-xdoc/1.4/doxia-module-xdoc-1.4.jar
[ERROR] urls[28] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-module-fml/1.4/doxia-module-fml-1.4.jar
[ERROR] urls[29] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-module-markdown/1.4/doxia-module-markdown-1.4.jar
[ERROR] urls[30] = file:/Volumes/ssd/dev/tools/maven/repo/org/pegdown/pegdown/1.2.1/pegdown-1.2.1.jar
[ERROR] urls[31] = file:/Volumes/ssd/dev/tools/maven/repo/org/parboiled/parboiled-java/1.1.4/parboiled-java-1.1.4.jar
[ERROR] urls[32] = file:/Volumes/ssd/dev/tools/maven/repo/org/parboiled/parboiled-core/1.1.4/parboiled-core-1.1.4.jar
[ERROR] urls[33] = file:/Volumes/ssd/dev/tools/maven/repo/org/ow2/asm/asm/4.1/asm-4.1.jar
[ERROR] urls[34] = file:/Volumes/ssd/dev/tools/maven/repo/org/ow2/asm/asm-tree/4.1/asm-tree-4.1.jar
[ERROR] urls[35] = file:/Volumes/ssd/dev/tools/maven/repo/org/ow2/asm/asm-analysis/4.1/asm-analysis-4.1.jar
[ERROR] urls[36] = file:/Volumes/ssd/dev/tools/maven/repo/org/ow2/asm/asm-util/4.1/asm-util-4.1.jar
[ERROR] urls[37] = file:/Volumes/ssd/dev/tools/maven/repo/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
[ERROR] urls[38] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-decoration-model/1.4/doxia-decoration-model-1.4.jar
[ERROR] urls[39] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-site-renderer/1.4/doxia-site-renderer-1.4.jar
[ERROR] urls[40] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar
[ERROR] urls[41] = file:/Volumes/ssd/dev/tools/maven/repo/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
[ERROR] urls[42] = file:/Volumes/ssd/dev/tools/maven/repo/commons-digester/commons-digester/1.8/commons-digester-1.8.jar
[ERROR] urls[43] = file:/Volumes/ssd/dev/tools/maven/repo/commons-chain/commons-chain/1.1/commons-chain-1.1.jar
[ERROR] urls[44] = file:/Volumes/ssd/dev/tools/maven/repo/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar
[ERROR] urls[45] = file:/Volumes/ssd/dev/tools/maven/repo/dom4j/dom4j/1.1/dom4j-1.1.jar
[ERROR] urls[46] = file:/Volumes/ssd/dev/tools/maven/repo/sslext/sslext/1.2-0/sslext-1.2-0.jar
[ERROR] urls[47] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar
[ERROR] urls[48] = file:/Volumes/ssd/dev/tools/maven/repo/antlr/antlr/2.7.2/antlr-2.7.2.jar
[ERROR] urls[49] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar
[ERROR] urls[50] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar
[ERROR] urls[51] = file:/Volumes/ssd/dev/tools/maven/repo/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
[ERROR] urls[52] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/maven/doxia/doxia-integration-tools/1.5/doxia-integration-tools-1.5.jar
[ERROR] urls[53] = file:/Volumes/ssd/dev/tools/maven/repo/org/codehaus/plexus/plexus-archiver/1.0/plexus-archiver-1.0.jar
[ERROR] urls[54] = file:/Volumes/ssd/dev/tools/maven/repo/org/codehaus/plexus/plexus-io/1.0/plexus-io-1.0.jar
[ERROR] urls[55] = file:/Volumes/ssd/dev/tools/maven/repo/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
[ERROR] urls[56] = file:/Volumes/ssd/dev/tools/maven/repo/org/apache/velocity/velocity/1.5/velocity-1.5.jar
[ERROR] urls[57] = file:/Volumes/ssd/dev/tools/maven/repo/oro/oro/2.0.8/oro-2.0.8.jar
[ERROR] urls[58] = file:/Volumes/ssd/dev/tools/maven/repo/org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar
[ERROR] urls[59] = file:/Volumes/ssd/dev/tools/maven/repo/org/codehaus/plexus/plexus-utils/1.5.10/plexus-utils-1.5.10.jar
[ERROR] urls[60] = file:/Volumes/ssd/dev/tools/maven/repo/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.jar
[ERROR] urls[61] = file:/Volumes/ssd/dev/tools/maven/repo/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar
[ERROR] urls[62] = file:/Volumes/ssd/dev/tools/maven/repo/org/mortbay/jetty/jetty-util/6.1.25/jetty-util-6.1.25.jar
[ERROR] urls[63] = file:/Volumes/ssd/dev/tools/maven/repo/commons-lang/commons-lang/2.5/commons-lang-2.5.jar
[ERROR] urls[64] = file:/Volumes/ssd/dev/tools/maven/repo/commons-io/commons-io/1.4/commons-io-1.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : org.apache.maven.doxia.siterenderer.DocumentContent
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

解决方法

重点看这句

[INFO] --- maven-site-plugin:3.3:site (default-site) @ order-center ---
[WARNING] Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version.
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:3.0.0

执行 [INFO] --- maven-site-plugin:3.3:site (default-site) @ order-center --- 之后,有一个警告:[WARNING] Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version.

在pom.xml中添加该插件后,问题解决

<build>
  <plugins>
    <!-- 添加该插件后,上述问题解决 -->
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-project-info-reports-plugin</artifactId>
      <version>2.7</version>
    </plugin>

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-site-plugin</artifactId>
      <version>3.3</version>
      <configuration>
        <locales>zh_CN</locales>
      </configuration>
    </plugin>
  </plugins>
</build>