I'm getting the following errormessage:
Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.18.0:release-finish (default-cli) on project parent: release-finish: error: pathspec 'master' did not match any file(s) known to git
That's because the branch is called main instead of master.
Renaming the branch to master is not an option.
Is there any way to pass the information about the main-branch to the maven-gitflow-plugin?
As stated in the errormessage I'm using the plugin version 1.18.0
I think this is configurable in the gitflow-maven-plugin configuration:
<gitFlowConfig>
<productionBranch>main</productionBranch>
</gitFlowConfig>
Related
We have recently migrated our multimodule(each module with a pom.xml) repository from SVN to GIT.SCM connection in all pom.xml files updated from svn to git.
When i am trying to create a branch from git repository using maven release plugin it fails with the below error
"Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:branch (default-cli) on project intgr: An error is occurred in the checkin process: Exception while executing SCM command. Error while executing command. Error while executing process. Cannot run program "/bin/sh" (in directory "/u01/remote-agent-home/xml-data/build-dir/IN-CDBFG-JOB1/mahirepository"): error=7, Argument list too long -> [Help 1]"
On examining logs i understand below command generated this error.
"[INFO] Checking in modified POMs... [INFO] Executing: /bin/sh -c cd /u01/remote-agent-home/xml-data/build-dir/IN-CDBFG-JOB1/mahirepository && git add -- intgr-parent/pom.xml archetypes/pom.xml and 1000 more pom files "
Is there a way i can workaround or fix this issue?
Maven version : Apache Maven 3.0.4
JDK version : 1.7.0_01
Maven command :
mvn -s ./settingsBamboo.xml --batch-mode release:branch -DbranchName=${bamboo.branchname} -DupdateWorkingCopyVersions=true -DsuppressCommitBeforeBranch=true -DautoVersionSubmodules=true -DremoteTagging=false -DupdateBranchVersions=false -X
I am currently facing this problem as well, but I got a bit further on this.
The issue has nothing to do with Java or Maven, it's a Linux limitation.
using getconfig MAX_ARGS you can find the max amount of bytes you can use as arguments.
Large maven commands can easily go beyond this, and the amount of bytes differs largely per distro.
Check the amount of bytes you can use, and try to get your command below that.
You could for example move into the build dir first, and then run the command relative.
Another solution would be to increase the amount of usable space, but I have so far not gotten that working.
If anyone does or you have fixed this yourself, let me know.
I use maven to create releases using gitflow-maven-plugin. My projects builds fine, unless I create a release calling the following maven command
mvn -B gitflow:release
This fails with the following error
[ERROR] Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.9.0:release (default-cli) on project test:
release: Remote branch 'origin/master' is ahead of the local branch 'master'.
Execute git pull. -> [Help 1]
There are no changes on the master so there should be no such error, especially also cause the plugin does a fetch beforehand as shown in the log
16:03:21 [INFO] Fetching remote branch 'origin master'.
16:03:21 [INFO] Comparing local branch 'master' with remote 'origin/master'
Any clue what could cause that?
When I downloaded the workspace zip archive to inspect the cause of this problem, git showed that that master branch was indeed behind the remote master.
In the Jenkinsfile I only did
git checkout develop && git pull --rebase
I fixed the problem by pulling the master branch, too
git checkout master && git pull --rebase
git checkout develop && git pull --rebase
Probably a git fetch also would have sufficed
I don't know if any of you do use the maven plugin jgitflow.
when running
clean jgitflow:release-start jgitflow:release-finish
on hudson, I get the following error:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start
(default-cli) on project test-git-release: Execution default-cli of goal
external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start
failed: String index out of range: -6
My pom.xml looks as follows:
<plugin>
<groupid>external.atlassian.jgitflow</groupid>
<artifactid>jgitflow-maven-plugin</artifactid>
<version>1.0-m5.1</version>
<configuration>
<enablesshagent>true</enablesshagent>
<defaultoriginurl>URL</defaultoriginurl>
<autoversionsubmodules>true</autoversionsubmodules>
<nodeploy>true</nodeploy>
<pushreleases>true</pushreleases>
<flowinitcontext>
<versiontagprefix>V_</versiontagprefix>
</flowinitcontext>
</configuration>
</plugin>
On my local machine I am able to run this command successfully.
Apparently is a known bug: official bug report, for the same version you mentioned and same behavior (working fine locally but same exception on Jenkins/Hudson).
Note that the linked bug report above provides a workaround maybe worth to try:
The workaround is in Jenkins:
Additional Behaviours
=> checkout to specific local branch
Update
According to the comments exchanged, proposed solutions and effective resolutions, here is the historical log for future helps:
Following the suggested workaround above and setting the local branch to checkout from origin/develop, the following error was encountered:
error occurred during unpacking on the remote end: unpack-objects abnormal exit
Such an error was actually due to permissions on the concerned folder, as also suggested by other SO threads, here and here. However changing the permissions afterwards did not help.
The issue was finally solved by creating the .git repository on the server itself. Doing so gave the group of the folder the same permissions as the owner.
A little timesaver for all the folks working with GitLab and experiencing this problem:
GitLab's Runner works on a DETACHED HEAD, which causes JGitFlow's search for GIT refs to fail, resulting in exactly this error.
The solution is as it is for Jenkins: before performing the JGitFlow operation, make a checkout. For GitLab you can do this by adding a git checkout in the /script part of the respective pipeline your gitlab-ci.yml, for example:
sample-pipeline:
stage: release
script:
-git checkout -B master
-mvn --batch-mode jgitflow:release-start jgitflow:release-finish
Since JGitFlow automatically checks out the develop branch and does its magic from there, you can always check out the master beforehand, as it has no effect at all; its just important that its not a DETACHED HEAD when GitLab starts its search for refs.
When giving release from hudson getting the below error
mavenExecutionResult exceptions not empty
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1:prepare (default-cli) on project parent: Unable to tag SCM
Provider message:
The svn tag command failed.
Command output:
svn: E235000: In file 'subversion/libsvn_client/commit_util.c' line 479: assertion failed ((copy_mode_root && copy_mode) || ! copy_mode_root)
/bin/sh: line 1: 23797 Aborted (core dumped) svn --username user --password 'pass*123' --no-auth-cache --non-interactive copy --file /tmp/maven-scm-1635387492.commit . http://codeserver.ennovate.com/source-repository/parent/tags/parent-4a.1503.2
I don't have any existing tag as /tags/parent-4a.1503.2/
I checked my credential and it was correct
Please help me to solve the problem
We found the same problem. There is one more report here:
https://mail-archives.apache.org/mod_mbox/subversion-users/201201.mbox/%3C2B173B138EFF584C846A48D41EFA3B420190AE53#server.tc.local%3E
Basically, if you have different ways to refer to the subversion server, for example, server and server.domain.com, you checkout a working copy from "server", but in the Maven root POM the SVN configuration points to server.domain.com, you will find this error.
You have to enter the same name in the elemento in the root POM, and in the svn command used to check-out a project from the Subversion sever.
I am setting up Maven project from a RTC repository on Team City. When I run the build on the project I am getting the following error:
"Failed to perform checkout on agent: Unable to start build as workspace name is null"
Does anyone has any idea how to fix this error.
More Details for the error:
Updating sources: agent side checkout
[VCS Root: Trunk] Agent Checkout
[Agent Checkout] Unable to start build as workspace name is null
[Updating sources] Failed to perform checkout on agent: Unable to start build as workspace name is null
Please check that build configuration has at least one build step (it can be a dummy or simple echo message).
I did face the same issue and could resolve it by creating a dummy step.