Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73216

Jenkins only displays commit but not the branch name

      I want to retrieve the code branch name during Java packaging. I am using the git-commit-id-plugin. In the git.properties file generated when running on my local computer, the value of git.branch is the branch name. However, in the git.properties file generated during packaging on the Jenkins environment server, the value of git.branch is the commit ID. 

      Here jenkins checks out the code in detached head mode.

      Note:- We had reached out to manitainer for this plugin and he asked to get fix from jenkins, Please find the link below for your refernce.

      https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/325

          [JENKINS-73216] Jenkins only displays commit but not the branch name

          Pasupula created issue -
          Pasupula made changes -
          Description Original: I want to retrieve the code branch name during Java packaging. I am using the git-commit-id-plugin. In the git.properties file generated when running on my local computer, the value of git.branch is the branch name. However, in the git.properties file generated during packaging on the Jenkins environment server, the value of git.branch is the commit ID. 
           * The Git Commit ID Maven Plugin from [https://github.com/ktoso/maven-git-commit-id-plugin] also fails to extract the branch (unsure why)

           

          Note:- We had reached out to manitainer for this plugin and he asked to get fix from jenkins, Please find the link below for your refernce.

          https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/325
          New: I want to retrieve the code branch name during Java packaging. I am using the git-commit-id-plugin. In the git.properties file generated when running on my local computer, the value of git.branch is the branch name. However, in the git.properties file generated during packaging on the Jenkins environment server, the value of git.branch is the commit ID. 
           * The Git Commit ID Maven Plugin from [https://github.com/ktoso/maven-git-commit-id-plugin] also fails to extract the branch (unsure why)

          Here jenkins checks out the code in detached head mode.

          Note:- We had reached out to manitainer for this plugin and he asked to get fix from jenkins, Please find the link below for your refernce.

          [https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/325]
          Environment New: Jenkins 2.440.3
          Mark Waite made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Pasupula made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Pasupula made changes -
          Comment [ We encountered this issue after upgrading Jenkins from version 2.289.3 to 2.426.3. Following the upgrade, the git branch attribute for the git-commit-id Maven plugin is not functioning correctly. We contacted the maintainer of the plugin, who suggested checking Jenkins for a fix. You can see the maintainer's comments on issue #325 via the link below. ]
          Mark Waite made changes -
          Status Original: Reopened [ 4 ] New: Open [ 1 ]
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Pasupula made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Pasupula made changes -
          Comment [ [~markewaite] , Thanks for quick response, We are following a multibranch pipeline. What I want to convey is that whenever a new branch is created in Git, it will appear in Jenkins to trigger the job to build the code for that particular branch. Each new branch will create a new workspace, and we are not using the same workspace for all branches ]
          Pasupula made changes -
          Assignee New: Mark Waite [ markewaite ]

            markewaite Mark Waite
            venky2291 Pasupula
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: