gpt4 book ai didi

java - 如何添加 Maven exec 任务以在 `mvn test` 上执行

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:57:12 25 4
gpt4 key购买 nike

我的 pom 中有以下执行任务:

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${project.basedir}/src/test/javascript/EnvJasmine/bin/run_all_tests.sh</executable>
</configuration>
</plugin>
</plugins>

这在我运行时效果很好

mvn exec:exec

但我也希望它在我执行时运行

mvn test

有人可以帮我吗?

最佳答案

明白了!您添加 <phase>执行死刑!

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>Jasmine Tests</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${project.basedir}/src/test/javascript/EnvJasmine/bin/run_all_tests.sh</executable>
</configuration>
</plugin>
</plugins>

哇哦!

关于java - 如何添加 Maven exec 任务以在 `mvn test` 上执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4821686/

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