Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does mvn release:perform always create a new snapshot version and upload that to the repository instead of the non-snapshot release version?

  1. I have created a public repo in Bitbucket to hold all the releases and snapshot releases for me.
  2. I am using wagon-git to upload the jar to the releases repository.

Here are my entries in pom.xml:

<pluginRepositories>
  <pluginRepository>
    <id>synergian-repo</id>
    <url>https://raw.github.com/synergian/wagon-git/releases</url>
  </pluginRepository>
</pluginRepositories>
...
<distributionManagement>
  <repository>
    <id>my id</id>
    <name>my repo name</name>
        <url>my repo url</url>
  </repository>
</distributionManagement>
...
<build>
  <extensions>
    <extension>
      <groupId>ar.com.synergian</groupId>
      <artifactId>wagon-git</artifactId>
      <version>0.2.5</version>
    </extension>
....
</build>

What I am doing:

  1. mvn clean package (creates snapshot version)
  2. mvn release:prepare (creates the new release version and uploads that jar and tags appropriately into my git repository)
  3. I checkin the updated pom.xml, release.properties etc.
  4. mvn release:perform - With this step I am expecting the new release version created by step 2 to be uploaded to my repository holding all the release jars.

Instead, mvn release:perform creates a new snapshot version and uploads that snapshot jar to the releases repository.

Question is: How do I manage to upload the non-snapshot release jar to the repository instead always creating and uploading a new snapshot version?

What am I missing?

like image 526
user1790625 Avatar asked Jun 23 '15 07:06

user1790625


People also ask

What does Mvn release perform do?

release:perform will fork a new Maven instance to build the checked-out project. This new Maven instance will use the same system configuration and Maven profiles used by the one running the release:perform goal.

What is difference between snapshot and release version?

A snapshot version is a version that has not yet been released. The general idea is to have a snapshot version before the released version.

Why do we use snapshot in Maven?

A Maven snapshot is a special version of a Maven package that refers to the latest production branch code. It is a development version that precedes the final release version. You can identify a snapshot version of a Maven package by the suffix SNAPSHOT that is appended to the package version.

How often Maven should check for a newer snapshot artifact in the remote repository?

Artifacts with a newer timestamp take precedence no matter where they come from. With the default settings "remote timestamps" are checked only once every 24 hrs.


1 Answers

I found a solution to my problem here: mvn release:prepare not committing changes to pom.xml…. The problem was that at the end of the release:prepare step, the pom.xml was not getting committed, and hence release:perform step was compiling and generating the snapshot version again. I am using maven-release-plugin 2.5.2 and maven-scm-provider-gitexe version 1.9.2

like image 156
user1790625 Avatar answered Sep 20 '22 21:09

user1790625