0

Is this possible? I'm trying to access the linux env variable M2_REPO inside my Jenkinsfile using the Jenkins pipeline plugin, however it's constantly empty. I can run it on my bash shell just fine:

root@host-VirtualBox:~#  echo $M2_REPO
/media/sf_apache-maven-repository

But running the command in a Jenkinsfile doesn't print anything:

sh 'echo $M2_REPO' 

Does the Jenkinsfile have access to OS env variables?

1 Answer 1

1

When I set the variable using the Environment Inject plugin in jenkins it worked..

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.