0

I have around 15 maven profiles which are identical except that they have different systemPropertyVariables in their configuration. I would like to execute them all with a single command, and I know I can use this: Executing multiple maven profiles

Is it possible to do this without having to list all the profiles in the maven command, i.e. can I make a single profile within my POM file that, in turn, invokes multiple profiles? Alternatively if I could execute a single profile multiple times with different systemPropertyVariables, that would work too.

Sagol Goru
  • 43
  • 1
  • 4
  • Are you sure that profiles are the right tool for this job? Different executions of some plugins might be feasible too. – SpaceTrucker Dec 08 '20 at 19:48

1 Answers1

0

You can activate a profile depending on a property. This can be the same property for many profiles, so using something like -Dsomeprop=true on the command line can activate many profiles for you.

That said, having 15 profiles is quite unusual and you should analyse whether your construction is too complicated.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142