I need to get some of the Jenkins environment variables like BUILD_NUMBER and BUILD_URL and to inject them as variables in my Maven Java build.
I have added this to the pom.xml
<properties>
<jenkins.buildUrl>${env.BUILD_URL}</jenkins.buildUrl>
</properties>
and while building with just mvn install I'm trying to get the variable by
private static final String JENKINS_BUILD_URL = System.getProperty("jenkins.buildUrl");
but unfortunately the result is null...
What I'm doing wrong guys?