[英]Maven. Skip plugin execution when running tests
在我的pom.xml
我有frontend-maven-plugin
。
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<nodeVersion>v6.11.0</nodeVersion>
<npmVersion>3.10.10</npmVersion>
<workingDirectory>src/main/frontend</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
运行它需要一些时间,我运行测试时不需要这个插件。
运行mvn test
时是否可以不执行插件?
你听说过 Maven 配置文件吗? http://maven.apache.org/guides/introduction/introduction-to-profiles.html
我知道当你想测试一个包时,你不想构建一个更大的包。
您可以定义一个配置文件来准确选择要构建和测试的模块。
你有一个相关的问题:
如果它对您有帮助,请告诉我们!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.