Ticket #1785 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

Investigate better ways to use the maven-release-plugin

Reported by: dscho Owned by: dscho
Priority: major Milestone: imagej-2.5.0
Component: Build System Version:
Severity: serious Keywords:
Cc: curtis Blocked By:
Blocking: #1783

Description

The release:prepare goal of the maven-release-plugin pushes directly to master. It would be better if we could push to an orphan branch and just bump up the version in the master branch.

Maybe release:branch allows us to do so (see  http://maven.apache.org/maven-release/maven-release-plugin/examples/branch.html).

Change History

comment:1 Changed 6 years ago by dscho

It seems that release:branch tries to use a branch instead of a tag, which is not exactly what we want.

Probably it is better to do something like this:

# Prepare new release without pushing (requires the release plugin >= 2.1)
mvn --batch-mode release:prepare -DpushChanges=false -Dresume=false \
        -DreleaseVersion=<version>
# Squash the two commits on the current branch into one
git reset --soft HEAD^^
git commit -s -m "Bump to next development cycle"
# push the current branch and the tag
git push origin HEAD $(sed -n 's/^scm.tag=//p' < release.properties)

comment:2 Changed 6 years ago by dscho

This is now part of scijava-common:

 https://github.com/scijava/scijava-common/blob/master/bin/release-version.sh

It only misses the part where it checks out the tag, calls mvn clean verify deploy, and checks out the formerly-current branch using git checkout @{-1}. (Which is not hard to add, but time-consuming to test.)

Last edited 6 years ago by dscho (previous) (diff)

comment:3 Changed 6 years ago by dscho

  • Status changed from new to closed
  • Resolution set to fixed

With Curtis' recent changes to scijava-common's bin/release-version.sh, this issue is fully addressed.

Note: See TracTickets for help on using tickets.