Thanks, Max. This solved my problem.
Bogdan Matiu -
Senior Software Engineer
-Original Message-
From: Max Cooper [mailto:[EMAIL PROTECTED]
Sent: August 10, 2006 5:57 PM
To: Maven Users List
Subject: Re: Change profiles when defining a default profile - issue -
Maven2.0.
Use a property to control which profile is active, perhaps 'targetEnv'
or something.
For the profile you want to be active by default, use a ! in front of
the property name, to make it active when that property is NOT set:
activation
property
name!targetEnv/name
/property
/activation
Then use the property value activate one of the other profiles:
activation
property
nametargetEnv/name
valueqa/value
/property
/activation
-Max
Bogdan Matiu wrote:
Hi,
Situation: I want to have an active by default profile (dev) and still
be able to switch to other profiles like qa and prod. I didn't find
any
way of doing it. Please someone help me if you found a solution for
this
one.
What happens?
I've set up the activeByDefault property for the dev environment in
the
conf/settings.xml: activeByDefaulttrue/activeByDefault
When I run:
mvn help:active-profiles
I get the following response:
The following profiles are active:
- maestro (source: settings.xml)
- dev-servers (source: settings.xml)
- dev-servers (source: settings.xml)
Now when I'm trying to switch to another profile:
mvn help:active-profiles -P qa2-servers
The following profiles are active:
- maestro (source: settings.xml)
- dev-servers (source: settings.xml) = *dev profile is going to be
used*
- qa2-servers (source: settings.xml)
- dev-servers (source: settings.xml)
I've tried even with both -P and setting the *activation *value for
the qa profile and still:
mvn help:active-profiles -P qa2-servers -Denv=qa2
The following profiles are active:
- maestro (source: settings.xml)
- dev-servers (source: settings.xml) = *dev profile is going to be
used*
- qa2-servers (source: settings.xml)
- dev-servers (source: settings.xml)
This means that any property used from profiles in the FILTERED files
are still taken from dev profile and not from the desired qa2-servers
profile (which is not the desired behaviour!!!)
Thank you,
*Bogdan Matiu - *
Senior Software Engineer
Ph.: 416-848-8391 x 2237
Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Route1 Inc.
/*/Securing the Digital World/*/
This electronic mail transmission contains information from Route1,
Inc.
http://www.route1.com that is for the sole use of the intended
recipient and may contain confidential, privileged or proprietary
information. If you are not the intended recipient, please be aware
that
any disclosure, copying, distribution or use of this message, its
contents, or any attachment is prohibited. Any wrongful interception
of
this message is punishable as a federal crime. If you have received
this
message in error, please return a copy to the sender by electronic
mail
indicating the error. Then, please destroy the original message and
any
copies from your computer. Thank you.
-
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]