我目前正在使用 Maven 3 使用maven-site-plugin 。
该插件按预期生成所有报告,但由于我的项目布局(如下所示),显示的主站点不显示报告。谁能建议我们如何共享内容或添加链接以显示如何将链接放入 site.xml 以显示内容。谢谢
site\site.xml 文件如下所示。
<project name="MyProject">
<body>`enter code here`
<links>
<item name="My Site" href="http://hp.com" />
</links>
<menu name="Projects" inherit="top">
<item name="Description and Usage" href="index.html"/>
<item name="Goals" href="plugin-info.html"/>
<item name="Usage" href="usage.html"/>
<item name="FAQ" href="faq.html"/>
</menu>
<menu ref="reports"/>
</body>
</project>
运行该站点没有问题,该站点出现,但没有任何链接起作用,并且报告不可见。我认为这是因为我的项目设置不标准。我有以下设置
PARENT_PROJECT
-pom.xml (this is where maven-site-plugin is defined and used)
-src
site
site.xml
-target (all reports are here inc a index.html)
---x EAR Project
pom.xml
target (all reports are here inc a index.html)
---x WEBAPP Project
pom.xml
target (all reports are here inc a index.html)
---x JAR Project
pom.xml
target (all reports are here inc a index.html)
出于某种未知原因,当我运行 site:run 并输入“localhost:8080”时,EAR\target\index.html 中的 index.html 出现了,而不是 PARENT_PROJECT\target\index.html 文件?
请注意, mvn:site 是从 PARENT_PROJECT 运行的
将 POM 更改为包括
<site>
<id>nexus</id>
<name>site</name>
<url>http://localhost:8080</url>
</site>
由于它是一个多项目,现在按照此处的建议运行 site:stage http://maven.apache.org/plugins/maven-site-plugin/faq.html但注意到我无法运行该项目,因为 maven 声明“什么” mvn site”将为您做,在多项目构建中,为父级及其所有模块单独运行“mvn site”。父级和子级之间的链接在这里不起作用。但是,当您部署地点。”