Gradle-release-plugin not merging "main" to "release"

Hi!

I am having an issue using the gradle-release-plugin not working (see below).

Environment:

  • macOS Sequoia version 15.5
  • Gradle 8.14.2
  • ‘net.researchgate.release’, version: ‘3.1.0’
  • git version 2.39.5 (Apple Git-154)

“./gradlew release -i” is not merging changes from the “main” branch to the “release” branch. The command output always shows it produced no output [] (see below). And then, the release branch is not sync’ed with the latest from the “main” branch.

Running [git, merge, --no-ff, --no-commit, main] produced output: []

But if I do the “gradlew release” displayed in the “Running…” outputs steps manually, I see the following. And then, the “release” branch does get the updates from the “main” branch.

$ git checkout release
$ git merge --no-ff --no-commit main

The git merge command outputs “Automatic merge went well; stopped before committing as requested”

Below is the git repo with “settings.gradle.kts” and “app/build.gradle.kts”. Could someone check my “build.gradle.kts” and let me know if you see something wrong or missing some configuration?

Thank you so much.


Rubens Gomes

NOTE:
I had actually posted this question to the StackOverflow link below. Since I have not received any responses there, I thought about copying the link and issue to this board.

https://stackoverflow.com/questions/79675543/gradle-release-plugin-not-merging-main-to-release

That’s more a question to that plugin, not to Gradle itself.
But from a very quick look at gradle-release/src/main/groovy/net/researchgate/release/tasks/PreTagCommit.groovy at main · researchgate/gradle-release · GitHub I’d say it is a bug in the release plugin which only does the pre-tag commit if snapshot version is used, version was modified, or properties file was created, and in your case neither of this is true, but as you use a pushReleaseVersionBranch, you would still need a commit that finalizes the merge from main.

So as a work-around you could either:

  • ditch the separate release branch,
  • or start using ...-SNAPSHOT version,
  • or trick the plugin using
    tasks.preTagCommit {
      doFirst {
        extension.attributes["versionModified"] = true
      }
    }
    

until this is fixed in the plugin after you reported the problem.

Thank you so much. I added “-SNAPSHOT” to the version, and it worked.
Rubens

1 Like