zoukankan      html  css  js  c++  java
  • MVN test

    1. 忽略测试失败

    <project>
    [...]
    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
    <testFailureIgnore>true</testFailureIgnore>
    </configuration>
    </plugin>
    </plugins>
    </build>
    [...]
    </project>
    插件参数表达式
    testFailureIgnore Set this to true to ignore a failure during testing. Its use * Type: boolean
    * Required: No
    * Expression: ${maven.test.failure.ignore}

    这个表达式可以从命令行通过 -D 参数设置。
    	$ mvn test -Dmaven.test.failure.ignore=true

    2. 跳过单元测试

    <project>
    [...]
    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
    <skip>true</skip>
    </configuration>
    </plugin>
    </plugins>
    </build>
    [...]
    </project>

    在命令行,只要简单的给任何目标添加
    maven.test.skip 属性就能跳过测试:
    $ mvn install -Dmaven.test.skip=true
    ...
    [INFO] [compiler:testCompile]
    [INFO] Not compiling test sources
    [INFO] [surefire:test]
    [INFO] Tests are skipped.
    ...






  • 相关阅读:
    腾讯2面
    腾讯1面
    快手2面
    快手1面
    formData+ajax文件上传
    nginx限流&健康检查
    jvm crash分析
    Spring Cloud Gateway整合Eureka
    k8s-应用部署
    dockerfile-maven plugin自动镜像制作并发布
  • 原文地址:https://www.cnblogs.com/java20130722/p/3207312.html
Copyright © 2011-2022 走看看