Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/375.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
Java Maven+;詹金斯&x2B;运行测试后Testng生成失败_Java_Maven_Jenkins_Testng - Fatal编程技术网

Java Maven+;詹金斯&x2B;运行测试后Testng生成失败

Java Maven+;詹金斯&x2B;运行测试后Testng生成失败,java,maven,jenkins,testng,Java,Maven,Jenkins,Testng,我正在jenkins上运行一组测试,我得到以下结果: Tests run: 5, Failures: 1, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] -----------------------------------------------------------------

我正在jenkins上运行一组测试,我得到以下结果:

Tests run: 5, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:39 min
[INFO] Finished at: 2014-07-21T16:33:14-07:00
[INFO] Final Memory: 7M/18M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project barcoAutomation: There are test failures.
[ERROR] 
[ERROR] Please refer to C:\Code\Maven\.\Maven\barcoAutomation\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[INFO] Build failures were ignored.
[Maven] $ cmd /c call C:\Windows\TEMP\hudson8319915807901667722.bat
好吧,有些事情告诉我:maven surefire plugin:2.16是这里的问题,所以这里是我的pom文件供检查:

<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>com.barco.automation</groupId>
    <artifactId>barcoAutomation</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>barcoAutomation</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <!-- added -->
        <!-- <suiteFile>src/test/resources/barcoColor.xml</suiteFile> <suiteFile>src/test/resources/GeneralSettings.xml</suiteFile> -->
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8</version>
        </dependency>
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.42.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.10-FINAL</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.10-FINAL</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <suiteXmlFiles>
                    <suiteXmlFile>src/test/resources/barcoGeneralSettings.xml</suiteXmlFile>
                        <!-- <suiteXmlFile>${suiteFile}</suiteXmlFile> -->
                    </suiteXmlFiles>
                    <!--<suiteXmlFile>src/test/resources/GeneralSettings.xml</suiteXmlFile> 
                        <suiteXmlFiles> <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile> 
                        <suiteXmlFile>src/test/resources/NewFile.xml</suiteXmlFile> <suiteXmlFile>src/test/resources/barcoColor.xml</suiteXmlFile> 
                        </suiteXmlFiles> -->
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/test/resources/</directory>
            </resource>
        </resources>
    </build>
</project>

4.0.0
com.barco.automation
我看到的唯一区别是,我把插件放在plugin标签中,而在网站上它放在dependecy标签中

这里可能有什么错误

谢谢


注意:对于纯文本,我很抱歉,但是我不知道如何在代码上添加颜色=/maven命令成功运行,但是您的5个测试中有一个失败

Tests run: 5, Failures: 1, Errors: 0, Skipped: 0
失败的测试将导致生成“失败”

看看:

C:\Code\Maven\.\Maven\barcoAutomation\target\surefire-reports

查看哪个测试失败以及失败原因。

您是否在本地运行mvn安装?