[英]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.