gpt4 book ai didi

Maven 项目 + maven-site-plugin 不工作

转载 作者:行者123 更新时间:2023-12-01 10:35:37 24 4
gpt4 key购买 nike

我目前正在使用 Maven 3 使用 ma​​ven-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 站点”将为您做的是分别为父级及其所有模块运行“mvn 站点”。父级之间的链接和 child 不会在这里工作。但是,当您部署该站点时,他们会工作。”

最佳答案

您应该考虑使用 site:stage maven-site-plugin 的目标也是如此。从该链接:

[site:stage] can be used to test that links between module sites in a multi module build works.

关于Maven 项目 + maven-site-plugin 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7027258/

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