While on the topic, I'd like to mention that having a different build
(through profiles for example) for each environment is not good. In Maven,
there can only be one flavor of a released artifact. So if you build v1.0 of
your war, cannot rebuild it with a different content.

What you should do is build different artifacts for each environment. Use
classifiers or, in my opinion even better, different Maven projects. This
have been discussed several times on this list about a month ago or so.

/Anders
On Tue, Oct 26, 2010 at 23:42, Jon Paynter <[email protected]> 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?
>

Reply via email to