I'm having trouble with the jgitflow:hotfix-finish goal. It seems to always fail on a merge conflict if you update the parent POM version in a project inside of a hotfix branch. Some details:
- One parent project for 35 discrete child modules
- All in different repos, these are not Maven multi-module projects in relation to the parent
- I want to share a common release version across projects
To accomplish this, I iterate through the modules in order of their dependency graph with the parent being first and start the hotfixes:
- Start a hotfix (hotfix-start) on the project
- Bump its parent version up to the hotfix SNAPSHOT version
- Commit, push, clean and deploy
<...Make any changes for the hotfix itself...>
To finish the hotfixes:
- Update the parent to the release version
- Commit and push
- Finish the hotfix (hotfix-finish)
Pseudocommands:
(develop) mvn -DreleaseVersion=${NEXT_VERSION} -DallowSnapshots=true jgitflow:hotfix-start
(hotfix-4.11.13) mvn -DparentVersion=[${NEXT_VERSION}-SNAPSHOT] -DgenerateBackupPoms=false -DallowSnapshots=true versions:update-parent
(hotfix-4.11.13) git add pom.xml
(hotfix-4.11.13) git commit --allow-empty -m "Updating pom.xml to latest parent SNAPSHOT versions."
(hotfix-4.11.13) git push
(hotfix-4.11.13) mvn clean deploy
<...Make any changes for the hotfix itself...>
(hotfix-4.11.13) mvn -DgenerateBackupPoms=false -DparentVersion=[${NEXT_VERSION}] versions:update-parent
(hotfix-4.11.13) git add pom.xml
(hotfix-4.11.13) git commit --allow-empty -m "Updating pom.xml to latest parent RELEASE versions."
(hotfix-4.11.13) git push
(develop) mvn jgitflow:hotfix-finish
Error:
[INFO] (develop) copying pom versions...
[INFO] (develop) updating poms for all projects...
[INFO] turn on debug logging with -X to see exact changes
[INFO] (develop) updating pom for my-project...
[WARNING] Error running JGitFlow Extension
com.atlassian.jgitflow.core.exception.JGitFlowExtensionException: Error updating develop poms to previously cached versions
at com.atlassian.maven.plugins.jgitflow.extension.command.UpdateDevelopWithPreviousVersionsCommand.execute(UpdateDevelopWithPreviousVersionsCommand.java:70)
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.runExtensionCommands(AbstractGitFlowCommand.java:255)
at com.atlassian.jgitflow.core.command.AbstractBranchMergingCommand.doMerge(AbstractBranchMergingCommand.java:94)
at com.atlassian.jgitflow.core.command.AbstractBranchMergingCommand.doMerge(AbstractBranchMergingCommand.java:44)
at com.atlassian.jgitflow.core.command.AbstractBranchMergingCommand.doMerge(AbstractBranchMergingCommand.java:39)
at com.atlassian.jgitflow.core.command.HotfixFinishCommand.call(HotfixFinishCommand.java:128)
at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowHotfixManager.finish(DefaultFlowHotfixManager.java:93)
at com.atlassian.maven.plugins.jgitflow.mojo.HotfixFinishMojo.execute(HotfixFinishMojo.java:167)
<snip snip snip>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.atlassian.maven.plugins.jgitflow.helper.DefaultMavenExecutionHelper.reloadReactor(DefaultMavenExecutionHelper.java:143)
... 31 more
Caused by: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM C:\my-project\pom.xml: unexpected character in markup < (position: END_TAG seen ...<groupId>com.myproject</groupId>\r\n<<... @11:3) @ line 11, column 3
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:364)
... 36 more
[ERROR] Error merging into develop:
[ERROR] Merge of revisions e47a0ed2df39058078985b12518c128e8e3d421c, 5fcd5281bbb9ccb3ea4fdd34b7907550d38e2930 with base 41d545847493837cbd2562c362e22dc02e19d710 using strategy recursive resulted in: Conflicting.
[ERROR] see .git/jgitflow.log for more info
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
The problem occurs when the develop pom is being updated to avoid merge conflicts on the project version. Is there a way to specify that the parent version also be updated? Or even a way to always choose the pom from the develop branch (I realize the risk here)? Perhaps there is a combination of flags I need to pass to the plugin? The documentation is a little light so any help at all would be appreciated. If a code change is needed I could even put together a PR for this if someone can point me in the right direction. Thanks!