Closed robross0606 closed 2 years ago
I also tried with gitflow:release-start
and `gitflow which yielded basically the same error:
[2022-02-11T15:25:41.565Z] + mvn -B gitflow:release-start gitflow:release-finish
[2022-02-11T15:25:41.565Z] ----- withMaven Wrapper script -----
[2022-02-11T15:25:41.565Z] Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/var/lib/jenkins/workspace/_mock-java-shared-library_master@tmp/withMavenbcb7efa9/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/var/lib/jenkins/workspace/_mock-java-shared-library_master@tmp/withMavenbcb7efa9"
[2022-02-11T15:25:41.815Z] Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T18:41:47Z)
[2022-02-11T15:25:41.815Z] Maven home: /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.6.0
[2022-02-11T15:25:41.815Z] Java version: 11.0.2, vendor: Oracle Corporation, runtime: /var/lib/jenkins/tools/hudson.model.JDK/jdk11/jdk-11.0.2
[2022-02-11T15:25:41.815Z] Default locale: en_US, platform encoding: UTF-8
[2022-02-11T15:25:41.815Z] OS name: "linux", version: "4.14.262-135.489.amzn1.x86_64", arch: "amd64", family: "unix"
[2022-02-11T15:25:43.159Z] [INFO] [jenkins-event-spy] Generate /var/lib/jenkins/workspace/_mock-java-shared-library_master@tmp/withMavenbcb7efa9/maven-spy-20220211-152542-93112851724635433303219.log.tmp ...
[2022-02-11T15:25:43.410Z] [INFO] Scanning for projects...
[2022-02-11T15:25:43.660Z] [INFO]
[2022-02-11T15:25:43.660Z] [INFO] -------------< com.mycompany.mock:mock-java-shared-library >--------------
[2022-02-11T15:25:43.660Z] [INFO] Building Mock Java Shared Library 0.0.1-SNAPSHOT
[2022-02-11T15:25:43.660Z] [INFO] --------------------------------[ jar ]---------------------------------
[2022-02-11T15:25:43.660Z] [INFO]
[2022-02-11T15:25:43.661Z] [INFO] --- gitflow-maven-plugin:1.17.0:release-start (default-cli) @ mock-java-shared-library ---
[2022-02-11T15:25:45.005Z] [INFO] Checking for uncommitted changes.
[2022-02-11T15:25:45.005Z] [INFO] Local branch 'develop' doesn't exist. Trying to fetch and check it out from 'origin'.
[2022-02-11T15:25:45.005Z] [INFO] Fetching remote branch 'origin develop'.
[2022-02-11T15:25:45.005Z] [WARNING] There were some problems fetching remote branch 'origin develop'. You can turn off remote branch fetching by setting the 'fetchRemote' parameter to false.
[2022-02-11T15:25:45.005Z] [INFO] Creating a new branch 'develop' from 'origin/develop' and checking it out.
[2022-02-11T15:25:45.005Z] [INFO] ------------------------------------------------------------------------
[2022-02-11T15:25:45.005Z] [INFO] BUILD FAILURE
[2022-02-11T15:25:45.005Z] [INFO] ------------------------------------------------------------------------
[2022-02-11T15:25:45.005Z] [INFO] Total time: 1.625 s
[2022-02-11T15:25:45.005Z] [INFO] Finished at: 2022-02-11T15:25:44Z
[2022-02-11T15:25:45.005Z] [INFO] ------------------------------------------------------------------------
[2022-02-11T15:25:45.005Z] [INFO] [jenkins-event-spy] Generated /var/lib/jenkins/workspace/_mock-java-shared-library_master@tmp/withMavenbcb7efa9/maven-spy-20220211-152542-93112851724635433303219.log
[2022-02-11T15:25:45.005Z] [ERROR] Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.17.0:release-start (default-cli) on project mock-java-shared-library: fatal: 'origin/develop' is not a commit and a branch 'develop' cannot be created from it -> [Help 1]
[2022-02-11T15:25:45.005Z] [ERROR]
[2022-02-11T15:25:45.005Z] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[2022-02-11T15:25:45.005Z] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[2022-02-11T15:25:45.005Z] [ERROR]
[2022-02-11T15:25:45.005Z] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[2022-02-11T15:25:45.005Z] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
script returned exit code 1
I've added more logs for verbose mode. As for the reason, do you need fetching in that case at all? Maybe set fetchRemote
to false. You can try running git fetch
directly and see the output.
I had similar error in Bitbucket Pipelines:
[INFO] --- gitflow-maven-plugin:1.19.0:release-finish (default-cli) @ ................. ---
[INFO] Checking for uncommitted changes.
[INFO] Checking out 'release/2.2.2' branch.
[INFO] Checking for SNAPSHOT versions in dependencies.
[INFO] Fetching remote from 'origin'.
[INFO] Fetching remote from 'origin'.
[INFO] Comparing local branch 'development' with remote 'origin/development'.
[INFO] Fetching remote from 'origin'.
[INFO] Local branch 'master' doesn't exist. Trying check it out from 'origin'.
[INFO] Creating a new branch 'master' from 'origin/master' and checking it out.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.305 s
[INFO] Finished at: 2023-04-03T07:49:32Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.19.0:release-finish (default-cli) on project ksef-integration-service-multitenant: release-finish: fatal: 'origin/master' is not a commit and a branch 'master' cannot be created from it -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
changing clone options fixed the problem:
clone:
depth: full
it can by add on step or whole pipeline level https://support.atlassian.com/bitbucket-cloud/docs/git-clone-behavior/.
We have a very simple "mock" gitflow project we're attempting to prove out with this plugin via Jenkins and Bitbucket. When we run a release build via Jenkins, it calls:
Our
pom.xml
file has:We create a merge request from
develop
tomaster
which triggers the release build. For some reason, the plugin errors with a fairly vague message:It is difficult to understand what "some problems" means and we already have![image](https://user-images.githubusercontent.com/2965467/153614904-2e10b752-b41d-4deb-9ab0-c917cec05c7e.png)
verbose
set to true. Any advice on what may be wrong with this setup? We absolutely have anorigin/develop
branch since this is the source of the PR: