【发布时间】:2014-11-10 21:18:15
【问题描述】:
我们有一个项目 A,它从另一个项目 B 下载一个工件,对它执行一个操作,然后吐出一个新的工件。我们使用 maven-dependency-plugin 中的 'dependency:copy' 目标从我们的 Maven 存储库中获取此项目 B 工件。
当我们执行 Maven 发布时,我希望 maven-release-plugin 的 'release:prepare' 目标检查所有依赖项,如果找到任何 SNAPSHOT 版本则失败。这适用于我们<dependencies><dependency>...</dependency></dependencies> 标签下的正常依赖项,但不适用于 maven-dependency-plugin 复制的工件“依赖项”。
我如何(如果有的话)将这些复制的工件的版本公开给 maven-release-plugin 的准备测试,并确保我们永远不会构建包含项目 B 快照的项目 A 版本?
如果上下文有帮助,这里是我们 pom 中 maven-dependency-plugin 设置的简化版本:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>process-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${ProjectBGroupID}</groupId>
<artifactId>${ProjectB}</artifactId>
<version>${ProjectBVersion}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
标签: maven maven-release-plugin maven-dependency-plugin