Closed simontunnat closed 2 years ago
I had a hard time creating a minimal integration test for this. :/ I will inspect further as this might have something to do with one of the other plugins we are using.
Not clear. How development branch changes are related to hotfix? How project reloading is related to merging?
Same exceptions here after upgrading to version 1.18.
This might has to do with #324? At least "Error re-loading project info" indicates that.
Unfortunately, the stack trace stops there. Could add the full stack trace?
@wumpz Which exception? Can you be more specific. Steps to reproduce?
Sorry. Typo. Same error for missing version information. I guess those versions ar defined in the roots dependency management section
Here the full stracktrace:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for org.tunnat.maven:gitflow-ci-new-merge-behaviour-issue-example 1.1-SNAPSHOT:
[INFO]
[INFO] org.tunnat.maven:gitflow-ci-new-merge-behaviour-issue-example FAILURE [ 0.343 s]
[INFO] module-a ........................................... SUCCESS [ 0.002 s]
[INFO] module-b ........................................... SUCCESS [ 0.001 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.538 s
[INFO] Finished at: 2022-05-02T06:51:25+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.18.0:release-finish (default-cli) on project gitflow-ci-new-merge-behaviour-issue-example: release-finish: Error re-loading project info: Some problems were encountered while processing the POMs:
[ERROR] [FATAL] Non-readable POM /home/simon/Workspace/github/simontunnat/maven-gitflow-ci-new-merge-behaviour-issue-example/module-b/pom.xml: /home/simon/Workspace/github/simontunnat/maven-gitflow-ci-new-merge-behaviour-issue-example/module-b/pom.xml (No such file or directory) @
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.18.0:release-finish (default-cli) on project gitflow-ci-new-merge-behaviour-issue-example: release-finish
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:577)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoFailureException: release-finish
at com.amashchenko.maven.plugin.gitflow.GitFlowReleaseFinishMojo.execute (GitFlowReleaseFinishMojo.java:392)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:577)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoFailureException: Error re-loading project info
at com.amashchenko.maven.plugin.gitflow.AbstractGitFlowMojo.reloadProject (AbstractGitFlowMojo.java:361)
at com.amashchenko.maven.plugin.gitflow.AbstractGitFlowMojo.checkSnapshotDependencies (AbstractGitFlowMojo.java:401)
at com.amashchenko.maven.plugin.gitflow.GitFlowReleaseFinishMojo.execute (GitFlowReleaseFinishMojo.java:224)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:577)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /home/simon/Workspace/github/simontunnat/maven-gitflow-ci-new-merge-behaviour-issue-example/module-b/pom.xml: /home/simon/Workspace/github/simontunnat/maven-gitflow-ci-new-merge-behaviour-issue-example/module-b/pom.xml (No such file or directory) @
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:397)
at com.amashchenko.maven.plugin.gitflow.AbstractGitFlowMojo.reloadProject (AbstractGitFlowMojo.java:348)
at com.amashchenko.maven.plugin.gitflow.AbstractGitFlowMojo.checkSnapshotDependencies (AbstractGitFlowMojo.java:401)
at com.amashchenko.maven.plugin.gitflow.GitFlowReleaseFinishMojo.execute (GitFlowReleaseFinishMojo.java:224)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:577)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I also built a minimal example repository for the issue:
https://github.com/simontunnat/maven-gitflow-ci-new-merge-behaviour-issue-example
(Checkout the develop
branch and execute the command mvn clean gitflow:release-finish -B -DcommitDevelopmentVersionAtStart -DuseSnapshotInRelease -DpushRemote=false
)
I think the issue is that Maven for some reason tries to evaluate the sub-module "module-b" when the release branch is checked out, even though the sub-module only exists in the "develop" branch.
This loop here gets all projects and these already include "module-b". :( https://github.com/aleksandr-m/gitflow-maven-plugin/blob/500151ee33e671e38ad662c7fdc10860b9d610b1/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java#L400
It seems by example project also fails with the release-finish goal with version 1.17.0. My initial problem did only occur with version 1.18.0.
@simontunnat Thanks for the repro.
It is not about merge behavior. It is about checking for SNAPSHOT dependencies with the new project reloading. We need to obtain projects the same way as the current project, and then there is no need to reload project in the loop.
1.19.0
is released.
The new merge behavior introduced with plugin version 1.18.0 causes issues in the following case:
The issue here seems to be that the plugin has checked out branch "release/22.4.0" but does not correctly reload the project info.
The problem does not occur if we set the "noBackMerge" and "noBackMergeHotfix" parameters or if we downgrade to version 1.17.0.
I could try to create a minimal test case for this if you need this to reproduce the error.