maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arend v. Reinersdorff" <>
Subject Re: Please reopen MNG-4533 Add an always active profile activator
Date Sat, 14 Nov 2015 21:06:09 GMT
Hi Karl Heinz,

good point. I'll try to elaborate more:

The idea is to have a profile which is always active, unless explicitly
deactivated. One can nearly achieve this with
<activeByDefault>true</activeByDefault>, but not quite because an
activeByDefault profile is deactivated if another profile from the same
pom.xml is activated.

So this is needed when:
- one profile should always be active, but can be turned off explicitly
- another profile can be activated, and activating it should not deactivate
the always active profile

Here's a concrete example. Solution taken from this answer on Stackoverflow

- a multi module project
- normally all modules are included in a build
- in some cases certain modules (data-foo and data-bar) should be excluded
from the build (in the Stackoverflow question because the tests took a long
time, I was researching it to exclude modules from Javadoc generation) The
modules are excluded with "mvn -!Pfull-build"
- also, there's another profile to change the target directory. Activating
this should not interfere with module exclusion. "mvn -PtargetInTemp clean
install" should still build all modules.

<!-- modules always included -->


            <!-- current, ugly workaround for an always active profile
                 MNG-4533 would improve this -->


        <!-- A profile commonly found in our company. Moves the target
directory to $TEMP.
             To build the project without interference from Eclipse. -->


Best regards,

On Sat, Nov 14, 2015 at 2:20 PM, Karl Heinz Marbaise <>

> Hi,
> On 11/14/15 2:03 PM, Arend v. Reinersdorff wrote:
>> Hi,
>> could issue MNG-4533 "Add an always active profile activator" please be
>> reopened?
>> The issues was automatically closed in 2014.
>> I find the current workarounds to create an always active profile (check
>> for non existing property, check for always existing file) quite ugly.
> The question is why do you need a profile which is always active ? In
> consequence i would ask why do you need a profile at all in such case? If
> it is always active you don't need a profile....
> May be you can elaborate more what you like to achieve and what the use
> case is?
> Kind regards
> Karl Heinz Marbaise
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message