Just realized that <activeProfiles/> isn't <activeByDefault/> so MNG-2136
doesn't make sense for my case.

It looks like some bug. When I just mention desired profile at settings.xml:

<settings>
    <profiles>
        <profile>
            <id>env-prod</id>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>env-prod</activeProfile>
    </activeProfiles>
</settings>

I got both as activated:

mvn help:active-profiles -Dmaven.test.skip=true
.
The following profiles are active:

 - env-prod (source: pom)
 - env-prod (source: settings.xml)

Without env-prod profile at settings.xml I get noone.

Den


        _____________________________________________
        From: Den Orlov [mailto:[EMAIL PROTECTED] 
        Sent: Saturday, June 09, 2007 7:38 PM
        To: 'users@maven.apache.org'
        Subject: profile activation rules
        

        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