Sorry for this. It's been a long time since I actually used that myself
and didn't test before posting. The following pom snippet does what you
want, based on the content of one property and not based on the presence
of multiple properties:
<profiles>
<profile>
<id>profileA</id>
<activation>
<property>
<name>environment</name>
<value>profileA</value>
</property>
</activation>
</profile>
<profile>
<id>profileB</id>
<activation>
<property>
<name>environment</name>
<value>profileB</value>
</property>
</activation>
</profile>
<profile>
<id>crosscutting</id>
<activation>
<property>
<name>environment</name>
</property>
</activation>
</profile>
</profiles>
I hope this solution finally works for you.
-Tim
William Ferguson schrieb:
Thanks Tim,
I hadn't considered activating a profile using multiple properties.
If it were possible, then I think it might work.
But
<activation>
<property>
<name>dev</name>
<name>prod</name>
</property>
</activation>
Is not valid syntax for the POM schema
http://maven.apache.org/maven-v4_0_0.xsd
William
-----Original Message-----
From: Tim Kettler [mailto:[EMAIL PROTECTED]
Sent: Friday, 24 August 2007 3:24 PM
To: Maven Users List
Subject: [***POSSIBLE SPAM***] - Re: Activating a Profile from another
Profile - Email has different SMTP TO: and MIME TO: fields in the email
addresses
Hi,
No, this is currently not possible directly. However, what you can do is
activate the set of profile via a system property you specify on the
commandline ('mvn -Ddev ...'):
<profiles>
<profile>
<id>dev</id>
<activation>
<property>
<name>dev</name>
</property>
</activation>
...
</profile>
<profile>
<id>prod</id>
<activation>
<property>
<name>prod</name>
</property>
</activation>
...
</profile>
<profile>
<id>common</id>
<activation>
<property>
<name>dev</name>
<name>prod</name>
</property>
</activation>
...
</profile>
</profiles>
-Tim
William Ferguson schrieb:
Is there any way to activatee a Profile from another Profile?
We have some pieces of the build, specifcally build.resources
definitions that vary depending on which Profile is targetted. But
some of the resource definitions are identical for several of the
Profiles.
So I had hoped to extract the common resource definitions into their
own Profile which was then activated by the target Profiles.
Hopefully that makes sense :-)
It seems this has been asked before without any +ve answer.
http://mail-archives.apache.org/mod_mbox/maven-users/200702.mbox/%3Ce7
52 [EMAIL PROTECTED]
But maybe the question was just overlooked.
Then again, perhaps there is a better way to come at this, in which
case I'm all ears.
William
---------------------------------------------------------------------
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]