maven-surefire-plugin配置

配置后可以在cmd执行测试 mvn test 即可执行测试
清理 mvn clean
• 编译 mvn compile
• 测试 mvn test
• 打包插件 mvn package
• 跳过测试
• mvn package -Dmaven.test.skip=true
• 导入到本地库 mvn install (自定义打包名称 在pom.xml添加)
• 出错调试 -X

    <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.7.1</version>
            
            <configuration>
            <!-- 设置系统变量,在后面定制化测试报表的时候用得上 -->
            <systemPropertyVariables>
            <org.umcommons.reportng.escape-output>false</org.umcommons.reportng.escape-output>
            </systemPropertyVariables>
            <!-- 忽略测试套件执行过程中失败的测试方法,继续执行剩余的测试类和测试方法 -->
            <testFailureIgnore>true</testFailureIgnore>
            <!-- 执行构建过程中的编码格式 -->
            <argLine>
            -DFile.encoding=UTF-8
            </argLine>
            <!-- 指定构建(执行套件)时要执行的套件的文件路径 -->
            <suiteXmlFiles>
                <suiteXmlFile>testng.xml</suiteXmlFile>
            </suiteXmlFiles>
            <!-- 是否跳过测试 -->
                <skipTests>false</skipTests>
            </configuration>
        </plugin>
        </plugins>
    </build>

猜你喜欢

转载自www.cnblogs.com/cekaigongchengshi/p/12800643.html
今日推荐