簡體   English   中英

Pom.xml無法創建報告結果的輸出目錄

[英]Pom.xml is failing to create output directory for reportng results

我已經瀏覽了許多帖子和博客,但是無法通過Maven生成reportngtestng-xslt報告。 最終我得到了教程,但是沒有運氣。 我不明白我在想什么。
這是我嘗試過的方法:它成功地在目標文件夾中生成了surefire報告,但沒有為reportng報告創建(生成報告)目錄。

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.testng.xslt</groupId>
    <artifactId>testng-xslt-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <name>TestNG XSLT Maven Plugin</name>
    <version>1.2</version>

    <prerequisites>
        <maven>2.0.4</maven>
    </prerequisites>

    <developers>
        <developer>
            <id>cosminaru</id>
            <name>Cosmin Marginean</name>
            <email>cosminaru@gmail.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.14.1</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>C:/Users/paul/Desktop/reporty-ng-1.2/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.reportyng</groupId>
                <artifactId>reporty-ng</artifactId>
                <version>1.2</version>
                <configuration>
                    <surefireReportDirectory>C:/Users/paul/Desktop/reporty-ng-1.2/target/surefire-reports</surefireReportDirectory>
                    <!--Setting the output directory -->
                    <outputDir>C:/Users/paul/workspace/windowspc/target/site/testng-xslt-plugin</outputDir>
                    <!--Setting the testNgXslt.showRuntimeTotals flag -->
                    <showRuntimeTotals>true</showRuntimeTotals>
                    <!--Setting the testNgXslt.cssFile parameter. This should be relative 
                        to the '${basedir}/target/site/testng-xslt' directory -->
                    <sortTestCaseLinks>true</sortTestCaseLinks>
                    <testDetailsFilter>FAIL,PASS,SKIP,CONF</testDetailsFilter>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>2.0.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.reporting</groupId>
            <artifactId>maven-reporting-api</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.reporting</groupId>
            <artifactId>maven-reporting-impl</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>saxon</artifactId>
            <version>8.7</version>
        </dependency>

        <!-- selenium and testng -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>2.34.0</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.34.0</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-support</artifactId>
            <version>2.34.0</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-api</artifactId>
            <version>2.34.0</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.3.1</version>
            <scope>test</scope>
        </dependency>
        <!-- selenium and testng -->

    </dependencies>
    <pluginRepositories>
        <pluginRepository>
            <id>reporty-ng</id>
            <url>https://github.com/cosminaru/reporty-ng/raw/master/dist/maven</url>
        </pluginRepository>
    </pluginRepositories>

</project>

看看: http : //maven.apache.org/surefire/maven-surefire-report-plugin/examples/report-custom-location.html

對於maven-surefire-report-plugin ,配置應包含outputDirectory標記,例如:

<outputDirectory>${project.basedir}/test-output</outputDirectory>

或者在使用maven- surefire -plugin時 ,設置reportsDirectory標簽,例如:

<reportsDirectory>${project.basedir}/test-output</reportsDirectory>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM