【发布时间】:2014-02-27 05:32:18
【问题描述】:
我在 Mac 10.9.1 上使用 Maven 3.1.1。我想根据某些子模块是否包含文件来激活配置文件。我已经尝试了以下
<profile>
<id>deploy-war-to-jboss</id>
<activation>
<file>
<exists>${session.executionRootDirectory}/src/main/webapp/WEB-INF/web.xml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${jboss.maven.plugin.version}</version>
<configuration>
<hostname>${jboss.remote.hostname}</hostname>
<port>${jboss.remote.port}</port>
</configuration>
<executions>
<execution>
<id>deploy-to-jboss</id>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
但在运行“mvm clean install”时,这个配置文件并没有被激活,尽管我已经验证了有问题的子模块包含该文件。我也试过 ${project.basedir} 没有运气。任何想法我如何做到这一点?
【问题讨论】:
标签: maven profile file-exists activation