我有两个不同环境的配置文件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> …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用内部定义的属性激活maven配置文件pom.xml:
<project>
[...]
<properties>
<run.it>true</run.it>
</properties>
[...]
<profiles>
<profile>
<activation>
<property><name>run.it</name></property>
</activation>
[...]
</profile>
</profiles>
[...]
</project>
Run Code Online (Sandbox Code Playgroud)
显然它不起作用.但是,激活可以从命令行进行:
mvn -Drun.it
Run Code Online (Sandbox Code Playgroud)
是"按设计"吗?如果是,那么可能的解决方法是什么?
我正在为Maven寻找一些Gradle执行器插件(类似于Maven ant-run插件).
谷歌没有帮助.
这样的插件可能不存在吗?