简体   繁体   English

Netbeans maven-surefire-plugin不生成HTML

[英]Netbeans maven-surefire-plugin not generating HTML

How can I run 'mvn'. 我如何运行“ MVN”。

I'm using Netbeans 7 and when I run my Unit tests, I do get generated XML files from my project /target folder 我正在使用Netbeans 7,并且在运行单元测试时,确实从我的项目/ target文件夹中获取了生成的XML文件。

/target/surefire-reports/TEST-package.name.ClassNameTest.xml /target/surefire-reports/TEST-package.name.ClassNameTest.xml

/target/surefire-reports/TEST-package.name.ClassNameTest.txt /target/surefire-reports/TEST-package.name.ClassNameTest.txt

But from all the xml and txt files from my test packages, 但是从我测试包中的所有xml和txt文件中,

I can't figure out how to generate a HTML Report. 我不知道如何生成HTML报告。

I'm currently using a Maven Netbeans Project. 我目前正在使用Maven Netbeans项目。 Here is my pom.xml file: 这是我的pom.xml文件:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.11.0</version>
    </dependency>  
</dependencies>
<groupId>com.honeycomb</groupId>
<artifactId>com.honeycomb</artifactId>

<!-- To use the report goals in your POM or parent POM -->  
<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.10</version>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
            </configuration>
        </plugin>
    </plugins>
</reporting>

I can get my tests to pass fine, I use the built in Unit Runner with Junit4 in Netbeans. 我可以通过我的测试,我在Netbeans中将内置的Unit Runner与Junit4一起使用。

I have googled all over the place, all I find is poorly documented examples and not a complete walkthrough on how to generate a report HTML file with my test outcomes. 我到处搜索Google,发现的只是记录不足的示例,而不是关于如何生成具有测试结果的报告HTML文件的完整演练。

Not sure if this is relevant but Im developing under Windows XP. 不知道这是否相关,但是我正在Windows XP下开发。 JDK 7. The Maven I use is straight out of the Netbeans Project. JDK 7.我使用的Maven直接来自Netbeans项目。

I have seen posts and examples through using: 我通过使用以下方法看到了帖子和示例:

http://maven.apache.org/maven-1.x/plugins/junit-report/goals.html http://maven.apache.org/maven-1.x/plugins/junit-report/goals.html

junit-report:report and junit-report but I can't seem to figure out any of this stuff. junit-report:report和junit-report但我似乎无法弄清楚这些东西。

Just looking for a simple generated HTML file. 只是寻找一个简单的生成的HTML文件。

If you run the command mvn surefire-report:report , then you should find a file called target/site/surefire-report.html gets generated after surefire runs your tests again. 如果运行命令mvn surefire-report:report ,那么您应该找到一个名为target/site/surefire-report.html的文件,该文件将在surefire再次运行测试后生成。

If you're just running from the command-line, then I think this will get you what you want. 如果您只是从命令行运行,那么我认为这将为您提供所需的东西。 If you're using a CI server like Jenkins or Hudson, then I would suggest looking into the Sonar server and its reports. 如果您使用的是Jenkins或Hudson之类的CI服务器,那么我建议您查看Sonar服务器及其报告。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM