I have one pom.xml profile that is activated as

        <profile>
            <id>integration-test</id>
            <activation>
                <property>
                    <name>!maven.test.skip</name>
                </property>
            </activation>
            .

and a set of env-specific profiles a kind of

            <profile>
              <id>env-test</id>
              <properties>
                  <jdbc.url>jdbc:mysql://. </jdbc.url>
              </properties>
            </profile>
            <profile>
              <id>env-prod</id>
              <properties>
                  <jdbc.url>jdbc:mysql://. </jdbc.url>
              </properties>
            </profile>

Then I want to specify in my settings.xml that I work at prod host:

<settings>
 <activeProfiles>
   <activeProfile>env-prod</activeProfile>
 </activeProfiles>
</settings>

and run app without test step:

mvn jetty:run -Dmaven.test.skip=true

Looks like env-prod profile specified at settings.xml isn't picked up:

mvn help:active-profiles -Dmaven.test.skip=true
.
There are no active profiles.

Most probably this is due to this rules:

"If a profile that's embedded in POM is activated by a means *other* than
<activeByDefault/>, then all <activeByDefault/> triggers are suppressed."

from http://jira.codehaus.org/browse/MNG-2136#action_60678


Could you please describe me how I can handle desired behavior (some pom's
profiles deactivated by means of CLI property and other activated via
settings.xml)?

Thanks in advance,
Den Orlov

Reply via email to