我在Maven站点插件上遇到了麻烦。我有以下示例结构:
/parent-project
pom.xml
/src/site
/module-1
/branches
/tags
/trunk
pom.xml
/src
/module-2
pom.xml
/src我们有一个带有标记/分支/主干结构的模块,另一个没有(第一个模块有自己的部署周期)。假设父pom.xml是这样的:
<groupId>some.group</groupId>
<artifactId>parent-project</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<url>https://url/parent</url>
<modules>
<module>module-1/trunk</module>
<module>module-2</module>
<modules>
<distributionManagement>
<site>
<id>deployment</id>
<url>dav:https://url/deploy/site/</url>
</site>
</distributionManagement>当我查看模块的有效pom时,我们有如下内容:
<parent>
<groupId>some.group</groupId>
<artifactId>parent-project</artifactId>
<version>1.0</version>
</parent>
<groupId>some.group</groupId>
<artifactId>module-1</artifactId>
<version>2.0.0</version>
<url>http://url/parent/module-1/module-1</url>
<distributionManagement>
<site>
<id>deployment</id>
<url>dav:https://url/deploy/site/module-1/module-1</url>
</site>
</distributionManagement>和
<parent>
<groupId>some.group</groupId>
<artifactId>parent-project</artifactId>
<version>1.0</version>
</parent>
<groupId>some.group</groupId>
<artifactId>module-2</artifactId>
<version>2.0.0</version>
<url>http://url/parent/module-2</url>
<distributionManagement>
<site>
<id>deployment</id>
<url>dav:https://url/deploy/site/module-2</url>
</site>
</distributionManagement>由于某种原因,主干目录中嵌套的模块增加了两倍的相对urls (模块-1/模块-1),而另一个(/模块-2)则恢复正常。我是在一些Maven会议上失败了,还是缺少了其他的东西?
编辑:--这是有效的pom,真正的pom只是最小的:
<groupId>some.group</groupId>
<artifactId>parent-project</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<url>https://url/parent</url>
<modules>
<module>module-1/trunk</module>
<module>module-2</module>
<modules>
<distributionManagement>
<site>
<id>deployment</id>
<url>dav:https://url/deploy/site/</url>
</site>
</distributionManagement>和
<parent>
<groupId>some.group</groupId>
<artifactId>parent-project</artifactId>
<version>1.0</version>
</parent>
<groupId>some.group</groupId>
<artifactId>module-1</artifactId>
<version>2.0.0</version>和
<parent>
<groupId>some.group</groupId>
<artifactId>parent-project</artifactId>
<version>1.0</version>
</parent>
<groupId>some.group</groupId>
<artifactId>module-2</artifactId>
<version>2.0.0</version>发布于 2015-07-08 15:42:09
来自Maven站点插件的文档:
如果子项目从父POM继承站点URL,它们将自动附加它们以形成它们的有效部署位置。
事实上,这只是故事的一半:一旦父项目不是直接祖先,Maven就会生成不适当的url和site/url值。例如,一个不是根项目的父项目。
或者这里有模块-1/主干。在这种情况下,您必须明确声明url和site/url。
https://stackoverflow.com/questions/29377945
复制相似问题