1

I've got a very strange problem: Every time I want to release my open source project (hosted on github) maven is uploading a snapshot to my repository instead of the expected release.

I've found out, the problem is that the pom of the release tag (git) contains a snapshot version. It seems means release:prepare doesn't set the correct release version for the release tag.

I'm using maven 3.2.3 and git 2.0.1.

The pom.xml here.

Every hint is welcome.

Robert Scholte
  • 11,889
  • 2
  • 35
  • 44
Thilo Schwarz
  • 640
  • 5
  • 24

1 Answers1

2

I think it is because of https://jira.codehaus.org/browse/MRELEASE-812.

It should be fixed in 2.5. However see the comment

I used this plugin configuration

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.5</version>
    <dependencies>
        <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-gitexe</artifactId>
            <version>1.9.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-api</artifactId>
            <version>1.9.1</version>
        </dependency>
    </dependencies>
</plugin>

and it works for me.

PS: Use mvn release:prepare -DpushChanges=false when you test the plugin. The changes are only local than and you can reset them.

René Link
  • 48,224
  • 13
  • 108
  • 140
  • Interesting: maven-release-plugin 2.5.1 already uses maven-scm-1.9.2 (http://maven.apache.org/maven-release/maven-release-plugin/dependencies.html). In the original pom.xml the m-release-p was already locked to this version, which would suggest there's regression in 2.5.1. Can anyone confirm? – Robert Scholte Nov 22 '14 at 16:22
  • To confirm above solution. Moving to a version of the plugin >= 2.5 resolved this for me. – nomDePlum Jul 08 '15 at 08:02