Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ref master already exists #3

Open
ghost opened this issue Aug 22, 2013 · 0 comments
Open

Ref master already exists #3

ghost opened this issue Aug 22, 2013 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 22, 2013

To create a maven release of a git repository with the maven-release-plugin, everyone needs to configure in Job Configuration the local and remote branch. It's necesary both are the same, so, after the plugin has created the tag of the version on the remote repo, it will update the artifact version in the pom.xml of the remote branch.

*** I said this because if you don't use this configuration you can only deploy snapshots.

The git-plugin doesn't work properly when you use this configuration. I'm looking out if this issue is of git-plugin or jgit


Java and Apache Maven envs

Apache Maven 2.2.1 (r801777; 2009-08-06 16:16:01-0300)
Java version: 1.6.0_05
Java home: /hudson/java/jdk1.6.0_05/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.0.13-0.27-default" arch: "i386" Family: "unix"


Issue: Ref master already exists

Stack trace:

Commencing build of Revision 81096d406e530862b6083b58e9b48fe33898e4d4 (origin/master)
Checking out Revision 81096d406e530862b6083b58e9b48fe33898e4d4 (origin/master)
Cleaning workspace
FATAL: Could not checkout master with start point 81096d406e530862b6083b58e9b48fe33898e4d4
hudson.plugins.git.GitException: Could not checkout master with start point 81096d406e530862b6083b58e9b48fe33898e4d4
at hudson.plugins.git.GitAPI.checkoutBranch(GitAPI.java:836)
at hudson.plugins.git.GitSCM$1.invoke(GitSCM.java:820)
at hudson.plugins.git.GitSCM$1.invoke(GitSCM.java:805)
at hudson.FilePath.act(FilePath.java:791)
at hudson.FilePath.act(FilePath.java:773)
at hudson.plugins.git.GitSCM.getBuildConfig(GitSCM.java:805)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:766)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1515)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:521)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:428)
at hudson.model.Run.run(Run.java:1390)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:414)
at hudson.model.ResourceController.execute(ResourceController.java:82)
at hudson.model.Executor.run(Executor.java:137)
Caused by: org.eclipse.jgit.api.errors.RefAlreadyExistsException: Ref master already exists
at org.eclipse.jgit.api.CreateBranchCommand.call(CreateBranchCommand.java:133)
at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:216)
at hudson.plugins.git.GitAPI.checkoutBranch(GitAPI.java:828)
... 13 more

The trouble is with the master's ref inside the .git
Ex: /.hudson/jobs/testing-git-plugin/workspace/.git/refs/heads/master
If you delete it before each build, the process works fine.

Any help is apreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants