Jenkins Git plugin detached HEAD

后端 未结 9 2075
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 09:55

I am new to Git and also to Jenkins. My problem is that I can\'t get the Jenkins Maven release plugin to work.

When I build a common Maven build with Jenkins, it wor

9条回答
  •  长情又很酷
    2020-12-02 10:15

    UPDATE (November 2015): Please, note that this solution was given for a specific version of Git plugin (1.1.26). In later versions, the plugin was updated to make configuration easier.

    For Jenkins Git plugin version 1.1.26 try this:

    Go to Job Configuration. Scroll down to Git section and click "Advanced..." button under "Repositories". Then set:

    Name: origin
    Refspec: +refs/heads/branch-0.1:refs/remotes/origin/localbranchname
    

    Then click another "Advanced..." button and set:

    Checkout/merge to local branch (optional): localbranchname
    

    You can name the local branch as you like, but the destination in Refspec must match the local branch name in that optional field (in this case "localbranchname"). This will attach HEAD to localbranchname like this:

    HEAD -> refs/heads/localbranchname -> 7a698457751bdc043cfda631b81e3812c5361790
    

    Maven Release should pass now in Jenkins.

    By the way, this works for me with Jenkins 1.492 and Jenkins Git plugin version 1.1.26.

提交回复
热议问题