Hi List,

I have been struggling since a few days now with the following problem.
I want a profile to be enabled based on a project property, in my case
project.packaging.

I've tried doing this in the following way:

<activation>
    <property>
         <name>project.packaging</name>
         <value>war</value>
    </property>
</activation>

Unfortunately the profile is not being activated at all.

I also tried an example from the Maven Definitive Guide:

<property>
  <name>mavenVersion</name>
  <value>2.1.0</value>
</property>

… "The property element tells Maven to activate this profile if the property
mavenVersion is set to the value 2.0.5.
  mavenVersion is an implicit property that is available to all Maven
builds."

Unfortunately this isn't working either. (I changed the version to the Maven
build I am using).

I'm wondering whether it's actually possible to use project properties to
activate profiles.
According to the Maven Definitive Guide it is. This is a quote from the
books appendix:

"property
The profile will activate if Maven detects a property (a value which can be
dereferenced within the POM by ${name})
of the corresponding name=value pair."

Thinking that this could be a Maven bug, I tried versions 2.0.8, 2.0.9,
2.0.10 and 2.1.0. All show the same behavior.
I'm stuck at this and would really appreciate any input.

Thanks in advance.

Reply via email to