私は現在、 Maven3を使用して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」と入力すると、PARENT_PROJECT \ target \ index.htmlファイルではなく、EAR \ target \ index.htmlの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が「What」と述べているため、プロジェクトを実行できないことに気付きました。マルチプロジェクトビルドでは、「mvn site」は、親とそのすべてのモジュールに対して個別に「mvn site」を実行します。ここでは、親と子の間のリンクは機能しません。ただし、サイト。"