【问题标题】:Is there a way to control on Report of Surefire plugin?有没有办法控制 Surefire 插件的报告?
【发布时间】:2019-01-08 20:58:51
【问题描述】:

如果我们不想生成它,是否可以控制 Maven 项目的列出文件夹(目标文件夹)?

其中一个叫做“surefire-reports”来自“maven-surefire-plugin”,我们可以通过配置来控制它吗?如果我们不想生成这些。

POM.XML:

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                     <suiteXmlFiles> 
                         <suiteXmlFile>testng.xml</suiteXmlFile> 
                     </suiteXmlFiles>                       
                </configuration>
            </plugin>
        </plugins>
    </build>

【问题讨论】:

    标签: maven selenium selenium-webdriver maven-3 pom.xml


    【解决方案1】:

    skipSurefireReport:

    如果设置为 true,则将跳过安全报告生成。

    1. 类型:布尔值

    2. 必填:否

    3. 用户属性:skipSurefireReport

    4. 默认值:假

    https://maven.apache.org/surefire/maven-surefire-report-plugin/report-mojo.html#skipSurefireReport.

    skipSurefireTests:

    目标:

    mvn clean verify -DskipTests=true
    

    尝试使用上面提到的目标代码

     <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.22.0</version>
                        <configuration>
                       <skip.surefire.tests>${skipTests}</skip.surefire.tests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
    

    此代码将跳过万无一失的测试。

    Skip report generation using TestNG and sure-fire plugin

    Prevent unit tests in maven but allow integration tests

    【讨论】:

    • 仍在生成。我需要生成相同的票。根据 Maven 描述,它不应​​该生成它。
    • 它不工作。
    • 关于向 Apache 报告问题。
    猜你喜欢
    • 2017-02-05
    • 2018-09-05
    • 2010-11-19
    • 2010-12-27
    • 2011-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多