The profile could have been activated using -ProfileX, why am I seeing people bother to add in an activation property, e.g.
to allow activation using -DoX?
Is there any reason to use -D insteal of -P? Or you can achieve more things with -D as oppose to -P?
One usage of
-Dmyproperty instead of
-Pmyprofile is to activate several profiles using only one parameter.
Moreover, you can reuse the
-Dmyproperty in other parts of your POM, using
The property does not necessarily has to be set via the
-D maven option, it may also be a system property. So it is possible to switch between profiles without changing the invocation.
 from theMaven documentation:
-D, --define <arg> Defines a system property ... Properties defined on the command line are also available as properties to be used in a Maven POM or Maven Plugin