Skip to content

git.branch in maven under jenkins pipelines is wrong evaluated to the commit #325

Description

@tkleiber

I have maven pom.xml, where I use git.branch and git.commit.id.abbrev to create database schema for my tests.

pom xml

This works fine, when I call maven in my development environment.

mvn local correct

But when maven is called from a jenkins pipeline on the same branch, then git.branch is replaced with the full commit id.

mvn jenkins wrong

This seems to be related to the detached mode of jenkins pipeline working copies of the workspace:

git branch output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions