给定以下示例多模块项目:
其中 parent 是任何其他 pom 的父级,并且 app 具有 comp1 的依赖项。
通过发布发布:准备/执行工作正常只要 aggr 文件夹在 svn 存储库中具有相同的结构(repository/trunk/aggr/parent.pom,...)。
现在,当我想使用同一个项目但使用 svn:externals 时,release-plugin 不起作用,说明 comp1:
Can't release project due to non released dependencies : parent:pom:2.0-SNAPSHOT
存储库结构类似于
aggr 文件夹使用指向模块主干的外部对象,因此 check out 的工作副本类似于上面。
为什么 Maven 以不同的方式处理基于外部的模块,有没有办法克服这个问题?
编辑:svn:externals 项目的 pom 文件。与其他项目的 pom 文件的唯一区别是 scm 标签。在其他非外部项目中,只有聚合器具有 scm 标签。
外部父 pom.xml
<groupId>small.test</groupId>
<artifactId>parent</artifactId>
<version>2.0-SNAPSHOT</version>
<scm>
<connection>scm:svn:http://localhost/svn/small-test-ext/parent/trunk/</connection>
<developerConnection>scm:svn:http://localhost/svn/small-test-ext/parent/trunk/</developerConnection>
<url>http://localhost/svn/small-test-ext/parent/trunk/</url>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.1</version>
</plugin>
</plugins>
外部 aggr-pom.xml
小测试
parent
2.0-快照
<groupId>small.test</groupId>
<artifactId>aggr</artifactId>
<version>1.0-SNAPSHOT</version>
<scm>
<connection>scm:svn:http://localhost/svn/small-test-ext/aggr/trunk/</connection>
<developerConnection>scm:svn:http://localhost/svn/small-test-ext/aggr/trunk/</developerConnection>
<url>http://localhost/svn/small-test-ext/aggr/trunk/</url>
</scm>
<modules>
<module>parent</module>
<module>comp1</module>
<module>comp2</module>
<module>app</module>
</modules>
外部 app-pom.xml
<parent>
<groupId>small.test</groupId>
<artifactId>parent</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<groupId>small.test</groupId>
<version>3.0-SNAPSHOT</version>
<artifactId>app</artifactId>
<packaging>jar</packaging>
<scm>
<connection>scm:svn:http://localhost/svn/small-test-ext/app/trunk/</connection>
<developerConnection>scm:svn:http://localhost/svn/small-test-ext/app/trunk/</developerConnection>
<url>http://localhost/svn/small-test-ext/app/trunk/</url>
</scm>
<dependencies>
<dependency>
<groupId>small.test</groupId>
<artifactId>comp1</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
谢谢
康拉德
最佳答案
在您当前的项目中,您必须运行 mvn:release
对于每一个,因为您在不同的 svn 存储库中有项目或模块。如果您只想运行一个 mvn:release
您的存储库应如下所示:
svn_repository: branches/
tags/
trunk/
parent
comp1
comp2
app
pom.xml
关于带有 Svn :Externals and a multi-module project 的 Maven 发布插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16297499/