Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
maven sure fire插件报告为空_Maven_Junit_Jenkins_Soapui_Maven Surefire Plugin - Fatal编程技术网

maven sure fire插件报告为空

maven sure fire插件报告为空,maven,junit,jenkins,soapui,maven-surefire-plugin,Maven,Junit,Jenkins,Soapui,Maven Surefire Plugin,我的需求是通过maven运行多个SOAPUI测试用例,使用jenkins自动化它的构建,并生成测试结果报告。 除了最后一部分,我都做得很成功 现在我想生成所有测试用例结果的html报告。 我使用maven surefire报告插件来实现这一点 我关注了这篇文章 测试用例成功并成功生成报告,但报告中没有记录 我是不是遗漏了什么?是否有任何配置参数用于设置生成报告或其他内容的源路径 surefire报告是在${project.build.directory}/site文件夹中生成的。 SOAPUI

我的需求是通过maven运行多个SOAPUI测试用例,使用jenkins自动化它的构建,并生成测试结果报告。 除了最后一部分,我都做得很成功

现在我想生成所有测试用例结果的html报告。 我使用maven surefire报告插件来实现这一点

我关注了这篇文章 测试用例成功并成功生成报告,但报告中没有记录

我是不是遗漏了什么?是否有任何配置参数用于设置生成报告或其他内容的源路径

surefire报告是在${project.build.directory}/site文件夹中生成的。 SOAPUI测试用例的输出文件在${project.build.directory}/reports文件夹中生成

这是我写的pom.xml

<?xml version="1.0" encoding="UTF-8"?> <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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>soapTest</groupId>
<artifactId>soapTest</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 SoapUI Sample</name>
<url>http://maven.apache.org</url>

<pluginRepositories>
    <pluginRepository>
        <id>SmartBearPluginRepository</id>
        <url>http://www.soapui.org/repository/maven2/</url>
    </pluginRepository>
</pluginRepositories>

<build>
    <plugins>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId>
            <version>5.1.2</version>
            <configuration>
                <projectFile>soapui-project.xml</projectFile>
                <outputFolder>${project.build.directory}/test-classes</outputFolder>
                <junitReport>true</junitReport>
                <exportAll>true</exportAll>
                <printReport>true</printReport>
                <testSuite>Authenticate</testSuite>
            </configuration>

            <executions>
                <execution>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

    </plugins>
</build>

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.7.2</version>
        </plugin>

    </plugins>
</reporting>

4.0.0
肥皂试验
肥皂试验
罐子
1.0-快照
Maven 2 SoapUI示例
http://maven.apache.org
SmartBearPluginRepository
http://www.soapui.org/repository/maven2/
com.smartbear.soapui
soapui maven插件
5.1.2
soapui-project.xml
${project.build.directory}/test类
真的
真的
真的
证明…是真实的
测试
测试
org.apache.maven.plugins
maven surefire报告插件
2.7.2

Maven Surefire报告插件的第一行写着:

Surefire报告插件解析在
${basedir}/target/Surefire报告
下生成的
TEST-*.xml
文件

因此,如果您将soapui maven插件更改为:

<outputFolder>${basedir}/target/surefire-reports</outputFolder>
${basedir}/target/surefire报告
这应该行得通


还有一些方法可以更改maven surefire报告插件的默认位置。

示例pom.xml,其中也使用mvn site命令创建报告


4.0.0
com.smartbear.samples
soapui maven插件
罐子
1.0-快照
Maven 2 SoapUI示例
http://maven.apache.org
smartbear瑞典插件库
http://www.soapui.org/repository/maven2/
com.smartbear.soapui
soapui maven插件
5.3.0
测试
测试
globalweather-soapui-project.xml
真的
${basedir}/target/surefire报告
真的
真的
ENV=DEV
org.apache.maven.plugins
maven surefire报告插件
2.20.1
${basedir}/target/surefire报告
org.apache.maven.plugins
maven站点插件
2.1
${basedir}/target/surefire报告

我昨天做了此更改,可以运行测试并成功获取报告。谢谢!:)您是如何在詹金斯启用surefire report的?我添加了surefire插件,但报告仍然使用基本junit报告而不是surefire报告