【发布时间】:2011-09-12 15:38:21
【问题描述】:
我正在使用 Maven 3.0.3。我有一个从父级继承的项目……
<modelVersion>4.0.0</modelVersion>
<groupId>com.myco.util.ant</groupId>
<artifactId>selenium-framework</artifactId>
<packaging>jar</packaging>
<name>Myco Selenium Utils</name>
<parent>
<groupId>com.nna</groupId>
<artifactId>parent</artifactId>
<version>1.2-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
在我的父母 pom 中,我有以下个人资料。但是,我只希望这个配置文件在有人在父 pom 上进行构建时才处于活动状态,而不是在它的一个孩子上。有谁知道我可以如何调整以下内容,以便在有人构建子项目时不会激活它?
<profile>
<id>deploy-snapshot</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>deploy</phase>
<configuration>
<target>
<condition property="is-release">
<not>
<contains string="${project.version}" substring="SNAPSHOT" />
</not>
</condition>
<fail if="is-release" message="You can only deploy snapshot versions of this project." />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
谢谢, - 戴夫
【问题讨论】: