I have clean integration-test -DclassId=app
as a maven goal in a Jenkins Maven Job.
How can I retrieve this in Java using System.getenv();
? When I do this I am only seeing null.
I have clean integration-test -DclassId=app
as a maven goal in a Jenkins Maven Job.
How can I retrieve this in Java using System.getenv();
? When I do this I am only seeing null.
For command line options you have to use System.getProperty()
instead of System.getenv()
:
String id = System.getProperty("classId");
Find more details here.