Maven: 2.2.1
I have a maven project with multiple modules where multiple profiles are
defined. One of these profiles defines what environment we are currently
configured for. In the parent project pom.xml file, I define a number of
properties based on the profile in use. The problem is I need to do
something special (delete a file) every time unless I am in one environment.
If I create a profile for every value of the environment property, it
works. But I would like to do the following below. I have examined the
code and it does check for a ! symbol, but I am not sure this only works on
system properties or will this work on user properties. The following does
not work in Maven 2.2.1 and the profile is activated when I would think it
should not be. Is this intended behavior or a bug?
<properties>
<environment>dev</environment>
</properties>
<profiles>
<profile>
<id>not_dev</id>
<activation>
<property>
<name>environment</name>
<value>!dev</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>not_dev_file</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Environment = ${environment}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Thanks in advance,
Wayne