Hi Jon,

Jon Paynter wrote:

> Im trying to setup some build profiles for our various build environments
> (dev, qa, prod, etc).  but I cant get the 'dev' profile to be active. The
> envType property is set to a default value of 'dev' in my top level pom,
> but it will sometimes be given on the command line, and in that case,
> activate
> the appropiate profile for qa, or production.  The problem is I cant get
> the dev profile to activate by just setting property values inside my pom.
> 
> Fragment from my pom:
> <properties>
>     <envType>dev</envType>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> 
> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
>     <fwVersion>SFP401</fwVersion>
> </properties>
> 
> and then the profiles:
> <profile>
>     <id>dev</id>
>     <activation>
>       <property>
>         <name>envType</name>
>         <value>dev</value>
>     </property>
>     </activation>
> 
> based on the documentation I would think the dev profile would be active
> all
> the time.  but when I run 'mvn help:active-profiles'  I see:
> Active Profiles for Project 'myCompoany:app:pom:2.1':
> 
> The following profiles are active:
> 
> - nexus (source: settings.xml)
> 
> however if I run:  'mvn help:active-profiles -DenvType=dev'  then I see:
> Active Profiles for Project 'myCompany:app:pom:2.1':
> 
> The following profiles are active:
> 
> - nexus (source: settings.xml)
>  - dev (source: settings.xml)
> 
> 
> what am I missing here?

It does simply not work this way. You cannot activate a profile by a 
property defined in the current or parent POM. Profiles are resolved first 
to build the final POM in use. See help:effective-pom.

- Jörg



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to