2

I basically have the same question as this How to run build twice so that I can get two artifacts using different dependencies? with a couple of additions.

Can this be configured by a environment variable? We want to have multiple versions of Java on the machines and be able to choose which Java to use based on an environment variable. Also, we need to keep the artifacts separate as there are some conflicts, but in my research I've seen this is possible. (If not please point that out)

Community
  • 1
  • 1
Carlos Bribiescas
  • 4,197
  • 9
  • 35
  • 66

1 Answers1

0

You can choose the -P option when running mvn. P will choose from one of the profiles you specified.

You can easily do something like this in say, Jenkins:

  1. Create radio button option and track it with ${Env}

  2. During your build process, lets say you have: mvn clean & mvn compile & mvn install.

Just add the environment chosen : mvn clean & mvn compile & mvn install -P ${Env}

stan
  • 4,885
  • 5
  • 49
  • 72