I have the following code in my Jenkins pipeline script:
sh("alias git='/my/file/path/libexec/git-core/git'")
mvn "-e -X release:prepare"
The second line is calling git
and it fails with:
The git-tag command failed.
Command output:
/bin/sh: git: command not found
Caused by: org.apache.maven.plugin.MojoFailureException: Unable to tag SCM
That shouldn't happen because I am aliasing it first.
My suspicion is that the statements are ran in different shells.
Is that true? In which case, how can I prevent this?