I get the following error when I try to execute maven-jgitflow-plugin on Jenkins with the following command:
mvn -DenableSshAgent=true -DreleaseVersion=0.5 -DautoVersionSubmodules=true -DpushReleases=true jgitflow:release-start -X
The error message is:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.atlassian.maven.plugins:maven-jgitflow-plugin:1.0-alpha26:release-start (default-cli) on project netcentric-parent: Error starting release: error configuring remote git repo with url: null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error starting release: error configuring remote git repo with url: null
at com.atlassian.maven.plugins.jgitflow.ReleaseStartMojo.execute(ReleaseStartMojo.java:81)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: com.atlassian.maven.plugins.jgitflow.exception.JGitFlowReleaseException: error configuring remote git repo with url: null
at com.atlassian.maven.plugins.jgitflow.helper.DefaultProjectHelper.ensureOrigin(DefaultProjectHelper.java:573)
at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowReleaseManager.startRelease(DefaultFlowReleaseManager.java:140)
at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowReleaseManager.start(DefaultFlowReleaseManager.java:46)
at com.atlassian.maven.plugins.jgitflow.ReleaseStartMojo.execute(ReleaseStartMojo.java:77)
... 21 more
Caused by: org.eclipse.jgit.api.errors.TransportException: Nothing to fetch.
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:137)
at com.atlassian.maven.plugins.jgitflow.helper.DefaultProjectHelper.ensureOrigin(DefaultProjectHelper.java:569)
... 24 more
Caused by: org.eclipse.jgit.errors.TransportException: Nothing to fetch.
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1081)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:128)
... 25 more
The .git/config looks like
[core]
repositoryformatversion = 0
filemode = true
logallrefupdates = true
[remote "origin"]
url = ssh://git@<URL removed for privacy reasons.>
[branch "master"]
remote = origin
merge = refs/heads/master
[gitflow "branch"]
master = master
develop = develop
[branch "develop"]
remote = origin
merge = refs/heads/develop
[gitflow "prefix"]
feature = feature/
release = release/
hotfix = hotfix/
support = support/
versiontag =
To me it seems this error is triggered, because the fetch line is missing from the config in the remote section. This is not added by the Git plugin of Jenkins by default, because usually nothing is fetched there. The maven-jgitflow-plugin should be able to deal with such a case.