I'm by no means an expert on this. Your situation is much more complex
than the profile stuff I've used. I've not used a profiles.xml but instead
put them in the pom.xml. I suspect there's some sort of confusion between
the multiple files as well as setting <activeProfile> and
<activeByDefault> in different places.
There's one issue I do see, but it could be a typo. If you're using the
system property to activate the profile, you should use:
mvn -Denv=qa clean package -e
Note the equals sign instead of dash.
The other suggestion you got to use 'mvn help:active-profiles' is a good
one and helped me to debug some confusion I had.
Greg Vaughn
[EMAIL PROTECTED]
"Mick Knutson" <[EMAIL PROTECTED]> wrote on 10/18/2006 06:36:05 PM:
> Here is what I now have working:
>
> with "mvn clean package -e" or "mvn -Denv-qa clean package -e"
>
> None of the profiles get picked up correctly and all my parameters are
> missing.
>
>
> "mvn -P qa clean package -e" works just fine with the configuration
below.
>
> In the settings.xml the <env>dev</env> tag seems to override what is in
the
> profiles.xml, but when I remove it, then env seems to work if I specify
the
> -P on the command line
>
> *** BUT, I want to be able to run with zero parameters on the command
line
> and run the default profile but that does not seem to work
>
>
>
> <profile>
> <id>local</id>
>
> <properties>
> <env>dev</env>
>
> </properties>
> </profile>
>
> </profiles>
>
> <!--
| activeProfiles
| List of profiles that are active
> for all builds.
|-->
> <activeProfiles>
> <activeProfile>local</activeProfile>
> </activeProfiles>
>
> </settings>
>
>
> profiles.xml:
> ============
>
> <profilesXml>
> <profiles>
>
>
> <!--================================================================-->
> <!-- Local developer Profile. -->
>
> <!--================================================================-->
> <profile>
> <id>dev</id>
> <activation>
> <activeByDefault/>
> </activation>
> <properties>
> <env>dev</env>
> <compiler.debug>true</compiler.debug>
>
> <jazn.url>${jazn.url.dev}</jazn.url>
> <jazn.bind.dn>${jazn.bind.dn.dev}</jazn.bind.dn>
> <jazn.samaccount>${jazn.samaccount.dev}</jazn.samaccount>
>
> </properties>
> </profile>
>
> <profile>
> <id>qa</id>
> <activation>
> <property>
> <name>env</name>
> <value>qa</value>
> </property>
> </activation>
> <properties>
> <env>qa</env>
> <jazn.url>${jazn.url.qa}</jazn.url>
> <jazn.bind.dn>${jazn.bind.dn.qa}</jazn.bind.dn>
> <jazn.samaccount>${jazn.samaccount.qa}</jazn.samaccount>
> </properties>
> </profile>
>
> <profile>
> <id>uat</id>
> <activation>
> <property>
> <name>env</name>
> <value>uat</value>
> </property>
> </activation>
> <properties>
> <env>uat</env>
> <jazn.url>${jazn.url.uat}</jazn.url>
> <jazn.bind.dn>${jazn.bind.dn.uat}</jazn.bind.dn>
> <jazn.samaccount>${jazn.samaccount.uat}</jazn.samaccount>
> </properties>
> </profile>
>
> <profile>
> <id>prod</id>
> <activation>
> <property>
> <name>env</name>
> <value>prod</value>
> </property>
> </activation>
> <properties>
> <env>prod</env>
> <jazn.url>${jazn.url.prod}</jazn.url>
> <jazn.bind.dn>${jazn.bind.dn.prod}</jazn.bind.dn>
> <jazn.samaccount>${jazn.samaccount.prod}</jazn.samaccount>
> </properties>
> </profile>
>
>
> </profiles>
> </profilesXml>
======================================================================
Confidentiality Notice: The information contained in and transmitted with this
communication is strictly confidential, is intended only for the use of the
intended recipient, and is the property of Countrywide Financial Corporation or
its affiliates and subsidiaries. If you are not the intended recipient, you
are hereby notified that any use of the information contained in or transmitted
with the communication or dissemination, distribution, or copying of this
communication is strictly prohibited by law. If you have received this
communication in error, please immediately return this communication to the
sender and delete the original message and any copy of it in your possession.
======================================================================