【发布时间】:2015-10-30 19:09:04
【问题描述】:
我有一个过去使用 maven-release-plugin 成功发布的多模块 maven 项目。当我现在尝试发布时,它报告说我的依赖项中仍然有 SNAPSHOTS。所有的 SNAPSHOTS 都来自多模块父项目中的其他项目,我有 autoVersionSubmodules=true。
Project
| pom.xml // multimodule pom
|-BasePOM
| | pom.xml // This is parent pom to all projects
|-Proj1
| | pom.xml
|-Proj2
| | pom.xml // contains dependency to Proj1
唯一的版本信息在 BasePOM/pom.xml 和每个项目 pom 中的引用。依赖版本控制是使用 ${project.version}
BasePOM/pom.xml
<groupId>org.something</groupId>
<artifactId>BasePOM</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<!--other stuff -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagBase>${svn_root}/tags</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
<updateDependencies>true</updateDependencies>
<useReleaseProfile>false</useReleaseProfile>
</configuration>
</plugin>
</plugins>
</build>
项目/pom.xml
<parent>
<groupId>org.something</groupId>
<artifactId>BasePOM</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>BasePOM/pom.xml</relativePath>
</parent>
<!--other stuff -->
<modules>
<module>BasePOM</module>
<module>Proj1</module>
<module>Proj2</module>
</modules>
Proj1/pom.xml
<parent>
<groupId>org.something</groupId>
<artifactId>BasePOM</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../BasePOM/pom.xml</relativePath>
</parent>
<!--other stuff -->
Proj2/pom.xml
<parent>
<groupId>org.something</groupId>
<artifactId>BasePOM</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../BasePOM/pom.xml</relativePath>
</parent>
<!--other stuff -->
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Proj1</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
关于为什么 maven 报告我有“剩余的快照依赖项”有什么想法吗?
【问题讨论】:
标签: maven maven-release-plugin