我在 pom.xml
中有两个针对不同环境的配置文件,我必须运行 mvn -PTest1 install
和 mvn -PTest2 install
命令来获取这些配置文件。我们可以将两个单独的 Maven 命令集成到一个命令中吗(比如 mvn clean install
)?
这是我的 Pom 条目
<profiles>
<profile>
<id>Test1</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.5</jdk>
<os>
<name>Windows XP</name>
<family>Windows</family>
<arch>x86</arch>
<version>5.1.2600</version>
</os>
<property>
<name>sparrow-type</name>
<value>African</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>
com.endeca
</groupId>
<artifactId>
endeca_navigation_Test1
</artifactId>
<version>
6.1
</version>
<!--<version>stable</version> -->
<scope>
compile
</scope>
</dependency>
</profile>
<profile>
<id>Test2</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>1.5</jdk>
<os>
<name>Windows XP</name>
<family>Windows</family>
<arch>x86</arch>
<version>5.1.2600</version>
</os>
<property>
<name>sparrow-type</name>
<value>African</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>
com.endeca
</groupId>
<artifactId>
endeca_navigation_Test2
</artifactId>
<version>
6.1
</version>
<!--<version>stable</version> -->
<scope>
compile
</scope>
</dependency>
</dependencies>
</profile>
</profiles>
使用单个命令管理 hudson 作业将很有帮助
原文由 dinesh sharma 发布,翻译遵循 CC BY-SA 4.0 许可协议
根据 此处 的 文档 和讨论,尝试用逗号分隔配置文件名称: