【发布时间】:2014-09-16 16:08:39
【问题描述】:
我正在尝试为多模块项目构建站点。 我的工作空间是这样的:
+- application
| +- app1
| | +-- pom.xml
| +- app2
| +-- pom.xml
+- interface
| +- interf1
| | +-- pom.xml
| +- interf2
| +-- pom.xml
+- logic
| +- logic1
| | +-- pom.xml
| +- logic2
| +-- pom.xml
+-- pom.xml (parent one)
我想为这个项目建立一个分阶段的网站。 如果我停留在级别 0(根),它可以工作,但我无法导航到子模块,因为它们不在正确的文件夹中。
在文件系统中创建了什么:
stage
+- index.html <- A
+- dependencies.html
+- (...)
+-- application
| +-- app1
| | +-- index.html
| | +-- dependencies.html
| +-- app2
| +-- index.html
| +-- dependencies.html
(and so on...)
“A”的代码是什么:
<a href="app1/index.html" ..>
而不是
<a href="applications/app1/index.html" ..>
我不想更改我的项目结构。有没有办法指示 Maven 在创建暂存站点时保留文件夹结构?
我正在使用 Maven 3.0.4 和 maven-site-plugin 3.0。
父 pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<stagingDirectory>/home/me/stage</stagingDirectory>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.4</version>
</plugin>
</reportPlugins>
</configuration>
</plugin>
提前致谢
【问题讨论】:
-
如果您使用最新版本的站点插件会怎样?我认为至少达到 3.3。
-
还有 maven-project-info-repository-plugin 有一个更新的版本可用 (2.7) 见这里:maven.apache.org/plugins
-
@user944849 确实有效!最后一个版本是3.4,今年7月编辑!请发布一个答案,以便我能够确认它。
标签: maven maven-3 maven-site-plugin