首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >马文。运行测试时跳过插件执行

马文。运行测试时跳过插件执行
EN

Stack Overflow用户
提问于 2018-04-21 17:11:03
回答 2查看 9.6K关注 0票数 7

在我的pom.xml中有frontend-maven-plugin

代码语言:javascript
复制
<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时不执行插件

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-04-22 15:50:48

你听说过maven profile吗?http://maven.apache.org/guides/introduction/introduction-to-profiles.html

我知道当你想测试一个包的时候,你不会想要构建一个更大的包。

您可以定义一个配置文件,它可以准确地选择您想要构建和测试的模块。

你有一个相关的问题:

Disable maven plugins when using a specific profile

如果它对你有帮助,请告诉我们!

票数 2
EN

Stack Overflow用户

发布于 2018-06-26 00:29:26

前端-maven-plugin现在has specific keys来禁止执行特定的目标。例如,添加系统属性skip.npm将跳过npm执行。您可以在运行maven时这样添加它:

代码语言:javascript
复制
mvn test -Dskip.npm
票数 19
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49954161

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档