Hi Alexander,

Personally I avoid using activeByDefault, since as you encountered, it can
be confusing.

Instead, you can use activation based on system properties. That tends to
behave in a more intuitive way, and is also much more flexible, IMO.

Then instead of writing "-PmyProfile" you write "-DmyFeature=active" or
whatever.

Regards,
Curtis

On Mon, Jun 8, 2015 at 3:07 PM, Alexander Kriegisch <
alexan...@kriegisch.name> wrote:

> -P+abc does not work in the context described in Anders' answer: the
> profile in question is also declared in the same POM as the
> active-by-default one. I would have expected the '+' syntax to do what I
> want, but it does not.
>
> --
> Alexander Kriegisch
>
>
> > Am 08.06.2015 um 14:18 schrieb Stephen Connolly <
> stephen.alan.conno...@gmail.com>:
> >
> > -Pabc,xyz
> >
> > Means you are saying the following profiles are to be active: abc, xyz.
> By
> > specifying profiles you are saying do not use the default profiles
> >
> > -P+abc
> >
> > Means activate the profile abc in addition to the defaults
> >
> > -P-xyz
> >
> > Or
> >
> > -P!xyz
> >
> > Means ensure profile xyz is not active even if active by default
> >
> > On Monday, June 8, 2015, Alexander Kriegisch <alexan...@kriegisch.name>
> > wrote:
> >
> >> Hi Jenkins experts.
> >>
> >> When I do something like
> >>
> >>    mvn help:active-profiles
> >>
> >> for a module defining a profile inside its pom.xml with activeByDefault
> >> set to true, the corresponding profile is indeed active in addition to
> any
> >> profiles defined in settings.xml.
> >>
> >> Now when I do
> >>
> >>    mvn help:active-profiles -P Foo
> >>
> >> I see that Foo is active, the profiles from settings.xml are, too, but
> the
> >> profile from pom.xml is inactive. I would expect it to remain active
> >> because I have not specified anything like -P !MyPomProfile.
> >>
> >> I have tested with Maven 3.2.5, 3.3.1, 3.3.3, same behaviour in each
> >> version.
> >>
> >> Is my expectation wrong (the manual does not contradict it, at least) or
> >> is this a bug?
> >>
> >> Regards
> >> --
> >> Alexander Kriegisch
> >> http://scrum-master.de
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> <javascript:;>
> >> For additional commands, e-mail: users-h...@maven.apache.org
> >> <javascript:;>
> >
> > --
> > Sent from my phone
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to