Maven3通过属性激活轮廓
问题描述:
有POM:Maven3通过属性激活轮廓
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://maven.apache.org/POM/4.0.0">
{...}
<properties>
<skipTests>false</skipTests>
<skipTestExecution>false</skipTestExecution>
<skipSpecTests>${skipTests}</skipSpecTests>
<skipSpecTestExecution>${skipTestExecution}</skipSpecTestExecution>
</properties>
{...}
<profiles>
<profile>
<id>no-test-compile</id>
<activation>
<property>
<name>skipSpecTests</name>
<value>true</value>
</property>
</activation>
</profile>
</profiles>
</project>
我可以激活通过skipTests财产没有测试编译的个人资料?当然,我可以使用skipTests激活属性创建新的配置文件,但我认为有更好的方法来完成它。 谢谢。
P.S.明确的配置文件定义是不可取的。
答
那么mvn clean package -DskipTests=true -Pno-test-compile
呢?
+0
明确的配置文件定义是不可取的 – 2013-03-11 12:43:05
+1
@AndrewOrlov明确定义配置文件是最好的方法。不太模糊,实施起来也更简单。否则,只需从命令行显式设置属性值,并完全避免配置文件 – 2013-03-11 13:29:23
在命令行中是否使用了'-Dmaven.test.skip = true'选项? – kostja 2013-03-11 12:34:23