I have personally found the profile mechanism to be tricky to setup, but
you can generally achieve your goals by applying various activation
techniques, etc.
Profiles can be activated by properties. You could use a property to
activate your dev-crimson profile, specified like 'mvn
-DtargetEnv=dev-crimson'.
I am not certain, but perhaps the order the profiles in the list define
how property value conflicts will be resolved. But even if this is true,
it seems to lack the power to give precedence to a profile that is
activated by some means other than the command line.
A useful trick for avoiding conflicts when using property-activated
profiles is to have a profile with a default value for a property be
activated when the profile-selecting property is NOT set. You can do
this by specifying (e.g.) !targetEnv as the activation property for that
profile. And then have other profiles that set the property to something
else when the profile-selection property is set (activated when
targetEnv has a value of 'dev-crimson', etc.).
-Max
EJ Ciramella wrote:
Even more fun - if I specify a profile that only exists in my
settings.xml file, some of the resources don't even get processed.
What gives?
-----Original Message-----
From: EJ Ciramella [mailto:[EMAIL PROTECTED]
Sent: Friday, August 25, 2006 1:47 PM
To: Maven Users List
Subject: RE: probs with profiles - really stuck...
If two profiles are loaded and both have a property set in it, which one
takes precedence?
-----Original Message-----
From: EJ Ciramella [mailto:[EMAIL PROTECTED]
Sent: Friday, August 25, 2006 11:42 AM
To: Maven Users List
Subject: RE: probs with profiles - really stuck...
Is there really no way to do this folks? This would really nuke our
maven progress at this point.
-----Original Message-----
From: EJ Ciramella [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 24, 2006 6:48 PM
To: Maven Users List
Subject: probs with profiles
I have a question about profiles and their usage. Our build machines
have one path to things like jboss and other third party directories, in
the various qa stacks, these paths may be different. Additionally, a
property may change from project to project.
How come the sub projects don't get the second profile?!
E:\work\up-svcs\lty\proj\LTY-P000039>mvn help:active-profiles -P
LTY-P000039,dev-crimson -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Unnamed - lty:app:pom:1.0-SNAPSHOT
[INFO] Lty Utils
[INFO] Lty Crypto(Client)
[INFO] LtyModel
[INFO] LtyDataGen
[INFO] Crypto Server
[INFO] Upromise.com Site
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO]
------------------------------------------------------------------------
----
[INFO] Building Unnamed - lty:app:pom:1.0-SNAPSHOT
[INFO] task-segment: [help:active-profiles] (aggregator-style)
[INFO]
------------------------------------------------------------------------
----
[INFO] [help:active-profiles]
[INFO]
Active Profiles for Project 'lty:app:pom:1.0-SNAPSHOT':
The following profiles are active:
- dev-crimson (source: profiles.xml)
- LTY-P000039 (source: settings.xml)
Active Profiles for Project 'lty:lty-utils:jar:1.0-SNAPSHOT':
The following profiles are active:
- LTY-P000039 (source: settings.xml)
Active Profiles for Project 'lty:crypto:jar:1.0-SNAPSHOT':
The following profiles are active:
- LTY-P000039 (source: settings.xml)
Active Profiles for Project 'lty:lty-model:jar:1.0-SNAPSHOT':
The following profiles are active:
- LTY-P000039 (source: settings.xml)
Active Profiles for Project 'lty:lty-datagen:jar:1.0-SNAPSHOT':
The following profiles are active:
- LTY-P000039 (source: settings.xml)
Active Profiles for Project 'lty:cryptoServer:jar:1.0-SNAPSHOT':
The following profiles are active:
- LTY-P000039 (source: settings.xml)
Active Profiles for Project 'uprweb:uprweb:war:1.0-SNAPSHOT':
The following profiles are active:
- LTY-P000039 (source: settings.xml)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]