Skip to content

Ref master already exists #3

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions