0

有POM:

<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 属性激活 no-test-compile 配置文件吗?当然,我可以使用 skipTests 激活属性创建新的配置文件,但我认为有更优雅的方法可以做到这一点。谢谢。

PS 显式配置文件定义是不可取的。

4

1 回答 1

0

那么mvn clean package -DskipTests=true -Pno-test-compile呢?

于 2013-03-11T12:34:29.177 回答