peekay
peekay

Reputation: 1271

inject parameter into maven profile

does anyone know if it is possible to inject an environment variable into the mvn command. for example I would like to do the following in my jenkins build definition:

mvn -e -P ${env.profile} clean install assembly:assembly

my google foo is not turning up any way to do this outside the settings.xml and even that is not as dynamic as I need.

thanks in advance

Upvotes: 0

Views: 201

Answers (2)

basiljames
basiljames

Reputation: 4847

The second answer in this post should help you. It used maven-antrun-plugin

Upvotes: 0

Mark O'Connor
Mark O'Connor

Reputation: 77971

Just use the environment variable, directly:

Unix

mvn -e -P $profile clean install assembly:assembly

Windows

mvn -e -P %profile% clean install assembly:assembly

Upvotes: 1

Related Questions