我不得不将 maven 发布插件从版本 2.2.1 更新到 2.2.2 以解决一个错误,但是现在,在进行 maven 发布时,新版本的文件不会上传到我的分发管理中。
我尝试了以下方法:
mvn release:prepare
&mvn release:perform
使用版本 2.2.2 的 release-plugin:上传新的 SNAPSHOT-versionmvn release:prepare
使用 2.2.1 版,mvn release:perform
使用 2.2.2 版:上传新版本(这是我想要的)
所以不知何故,mvn release:perform
使用版本 2.2.2 的发布插件完成的设置出错了,但我真的不明白为什么会发生这种情况。
更新:我快速查看了我的 target\checkout 文件夹,并在那里找到了 SNAPSHOT 版本的 pom-s。因此,在发布期间将错误的版本移至结帐:准备。
更新 #2:我已将其范围缩小到与 git 相关的内容。target\checkout 文件夹的内容来自 git checkout。由于我也更新了 scm-plugin 的版本,因此它必须与此有关..
来自 pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<preparationGoals>clean install</preparationGoals>
<pushChanges>false</pushChanges>
</configuration>
<version>2.2.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>
[...]
<distributionManagement>
<repository>
<id>nexus-releases</id>
<url>http://repository/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://repository/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
我正在使用 Maven 2.2.1。