gpt4 book ai didi

maven - 如果在 Maven 3.x 中设置了系统属性 ID,如何运行 exec-maven-plugin?

转载 作者:行者123 更新时间:2023-12-02 17:50:15 25 4
gpt4 key购买 nike

如果设置了系统属性,我想运行“exec-maven-plugin”。我如何在 Maven 3.x 中完成此操作?

例如,给定:

mvn clean install -DrunTheExec="yes"

那么我该如何实现这个逻辑:

<!-- if $(runTheExec) == yes then run this plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
...
</plugin>

最佳答案

我正要添加与 Johnathon 相同的建议,但使用的个人资料略有不同。

<profiles>
<profile>
<id>runTheExec</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
...

然后激活它:

mvn clean install -PrunTheExec

关于maven - 如果在 Maven 3.x 中设置了系统属性 ID,如何运行 exec-maven-plugin?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9316363/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com