我在mvn验证网站上收到错误

时间:2015-11-09 19:40:11

标签: maven-plugin

它给了我指向其中一个pom文件的错误。我检查了插件,它不是null。我甚至将它更新到最新版本。仍然没有解决它。

目标的执行默认站点org.apache.maven.plugins:maven-site-plugin:3.4:站点失败:锚点名称不能为空

1 个答案:

答案 0 :(得分:0)

在很多情况下看起来像异常表面并且非常无益。

有一个issue a while back没有在pom中定义许可证名称会抛出此异常。

我遇到了这个异常(版本3.4),我在change.xml文件中输入了一个拼写错误(verison而不是version)。我只是看到它在ChangesReportGenerator课程中失败了。即便如此,我在看到它之前已经多次看了一下错字。

对于遇到此问题的其他人,请花点时间检查一下即使是最随机的拼写错误 - 这可能就是问题所在。

作为参考,这是来自日志的完整错误消息:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] example.products.parent ...................... SUCCESS [0.709s]
[INFO] Example Product .............................. FAILURE [2.199s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.162s
[INFO] Finished at: Fri Sep 02 12:53:19 CDT 2016
[INFO] Final Memory: 26M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.4:site (default-site) on project example.product: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.4:site failed: Anchor name cannot be null! -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.4:site (default-site) on project example.product: Execution default-site of goal org.apache.maven.
plugins:maven-site-plugin:3.4:site failed: Anchor name cannot be null!
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.4:site failed: Anchor name cannot be null!
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.lang.NullPointerException: Anchor name cannot be null!
        at org.apache.maven.doxia.sink.XhtmlBaseSink.anchor(XhtmlBaseSink.java:1545)
        at org.apache.maven.doxia.siterenderer.sink.SiteRendererSink.anchor(SiteRendererSink.java:253)
        at org.apache.maven.doxia.sink.XhtmlBaseSink.anchor(XhtmlBaseSink.java:1533)
        at org.apache.maven.plugin.issues.AbstractIssuesReportGenerator.sinkSectionTitle2Anchor(AbstractIssuesReportGenerator.java:181)
        at org.apache.maven.plugin.changes.ChangesReportGenerator.constructRelease(ChangesReportGenerator.java:528)
        at org.apache.maven.plugin.changes.ChangesReportGenerator.constructReleases(ChangesReportGenerator.java:511)
        at org.apache.maven.plugin.changes.ChangesReportGenerator.doGenerateReport(ChangesReportGenerator.java:230)
        at org.apache.maven.plugin.changes.ChangesMojo.executeReport(ChangesMojo.java:356)
        at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:196)
        at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:224)
        at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:311)
        at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:129)
        at org.apache.maven.plugins.site.render.SiteMojo.renderLocale(SiteMojo.java:182)
        at org.apache.maven.plugins.site.render.SiteMojo.execute(SiteMojo.java:141)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        ... 20 more
[ERROR]
[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/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command