I am using maven as build tool. I have set an environment variable called env. How can I get access to this environment variable’s value in the pom.xml file?
I am using maven as build tool. I have set an environment variable called
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check out the Maven Properties Guide…
As Seshagiri pointed out in the comments,
${env.VARIABLE_NAME}will do what you want.I will add a word of warning and say that a
pom.xmlshould completely describe your project so please use environment variables judiciously. If you make your builds dependent on your environment, they are harder to reproduce