简体   繁体   English

Pom.xml无法创建报告结果的输出目录

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

I have gone through many posts and blogs but couldn't generate reportng or testng-xslt reports via maven. 我已经浏览了许多帖子和博客,但是无法通过Maven生成reportngtestng-xslt报告。 Finally I have got this tutorial but no luck. 最终我得到了教程,但是没有运气。 I cant understand what am I missing. 我不明白我在想什么。
Here's what I have tried : It successfully generates the surefire reports in the target folder but doesnt create(generate reports) a directory for reportng reports. 这是我尝试过的方法:它成功地在目标文件夹中生成了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>

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

for maven-surefire-report-plugin , the configuration should include outputDirectory tag, eg: 对于maven-surefire-report-plugin ,配置应包含outputDirectory标记,例如:

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

Or when using maven-surefire-plugin , set reportsDirectory tag, eg: 或者在使用maven- surefire -plugin时 ,设置reportsDirectory标签,例如:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 xslt 更新 pom.xml 元素 - updating pom.xml elements using xslt 如何在maven pom.xml中使用自定义插件? - How to use custom plugin in maven pom.xml? 使用POM.xml为Webdriver脚本生成XSLT报告 - Generate XSLT reports for Webdriver scripts using POM.xml “通过build.xml生成报告”和“通过pom.xml生成报告”有什么区别? - What is the difference between “Generating reports via build.xml” and “Generating via pom.xml”? 需要执行XML输入和XSL的输出以创建XML输出 - in need to perform the output from XML input and XSL to create the XML output 使用XSLT创建PLSQL语句以输出XML - Using XSLT to create a PLSQL statement to output XML 当一个节点包含其他xml节点以及它们之间的空间时,XSLT无法在html输出中添加spacec - XSLT failing to add spacec in html output , when a node contains other xml nodes and space between them 使用XSLT的XML到XML:如何检查输出xml中是否存在元素,以及如何不使用默认值创建元素 - XML to XML using XSLT: How to check that element exists in output xml and if not create element with default value 需要帮助来创建XSL文件,该文件会将输入XML文件input.xml转换为output.xml格式 - Need help to create an XSL file that will transform the input XML file input.xml to the format of output.xml 如何从输入和输出XML文件创建XSLT样式表 - How to create XSLT stylesheet from input and output XML files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM