Maven release plugin 2.2.2 doesn't push to distributionmanagement

筅森魡賤 提交于 2020-01-07 11:22:28

问题


I had to update the maven release plugin from version 2.2.1 to 2.2.2 to get around a bug, but now, when doing a maven release, the files for the new version are not uploaded to my distribution management.

I have tried the following:

  • mvn release:prepare & mvn release:perform with version 2.2.2 of the release-plugin: Uploads the new SNAPSHOT-version

  • mvn release:prepare with version 2.2.1, mvn release:perform with version 2.2.2: Uploads the new version (which is what i want)

So somehow the setup done by mvn release:perform with version 2.2.2 of the release plugin gets things wrong, but I really can't see why this happens.

Update: I took a quick look in my target\checkout folder, and there the pom-s where for the SNAPSHOT-version. So the wrong version is moved to checkout during release:prepare.

Update #2: I've narrowed it down to something git-related. The contents of the target\checkout folder comes from a git checkout. Since I've updated the version of the scm-plugin as well it must have something to do with this..

From 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>

I'm using maven 2.2.1.


回答1:


Solved it by updating the maven-release-plugin to version 2.4. During release:perform it checked out a snapshot version and pushed this to the distribution management instead of the built version.



来源:https://stackoverflow.com/questions/13975187/maven-release-plugin-2-2-2-doesnt-push-to-distributionmanagement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!