aleksandr-m / gitflow-maven-plugin

The Git-Flow Maven Plugin supports various Git workflows, including GitFlow and GitHub Flow. This plugin runs Git and Maven commands from the command line.
https://aleksandr-m.github.io/gitflow-maven-plugin/
Apache License 2.0
494 stars 182 forks source link

Version update issue on release finsh #372

Closed sriram0721 closed 1 year ago

sriram0721 commented 1 year ago

Hi,

We use git flow maven plugin for starting and finishing the release. Lets say I have my develop with version 1.0.0-SNAPSHOT. When we take feature branch from develop, it bumps the feature version to 1.0.0-SNAPSHOT-1. and a PR to develop from features updates the develop to 1.0.0-SNAPSHOT-1 ( this is for allowing tag immutable for docker images as we are tagging docker images based on versions) .

Now I will start release with mvn git flow. it creates us release/1.0.0-SNAPSHOT-1 branch. We have a separate workflow to build docker images for release branch and bumps the release version as 1.0.0-RC1 , 1.0.0-RC2 etc. Now I want to finish my release. During this process, we encounter merge conflicts in pom with main.

19676 [INFO] Results:
19680 [INFO] 
19680 [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
19680 [INFO] 
19689 [INFO] ------------------------------------------------------------------------
19697 [INFO] BUILD SUCCESS
19700 [INFO] ------------------------------------------------------------------------
19710 [INFO] Total time:  17.579 s
19717 [INFO] Finished at: 2022-11-23T13:16:11Z
19724 [INFO] ------------------------------------------------------------------------
27006 [INFO] Checking out 'main' branch.
Your branch is up to date with 'origin/main'.
27036 [WARNING] Switched to branch 'main'
27042 [INFO] Merging (--no-ff) 'release/2.0.0-SNAPSHOT-2' branch.
Auto-merging pom.xml
CONFLICT (content): Merge conflict in pom.xml
Automatic merge failed; fix conflicts and then commit the result.
27068 [INFO] ------------------------------------------------------------------------
27073 [INFO] BUILD FAILURE
27073 [INFO] ------------------------------------------------------------------------
27075 [INFO] Total time:  24.992 s
27083 [INFO] Finished at: 2022-11-23T13:16:11Z
27087 [INFO] ------------------------------------------------------------------------
27088 [ERROR] Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.19.0:release-finish (default-cli) on project demo: release-finish: Auto-merging pom.xml
27092 [ERROR] CONFLICT (content): Merge conflict in pom.xml
27092 [ERROR] Automatic merge failed; fix conflicts and then commit the res
aleksandr-m commented 1 year ago

It can happen if you modify version in your main branch. And yes, merge conflicts do happen. What do you expect plugin should do in such case?