无法执行目标org.apache.maven.plugins:maven-surefire-plugin

无法执行目标org.apache.maven.plugins:maven-surefire-plugin,maven,surefire,Maven,Surefire,我正在远程webdrivers上执行一个SeleniumWebDriversMaven项目,每次运行它时,实际的测试用例都会通过,但由于以下错误,构建失败 这是我的运行控制台的输出。请有人帮我解决这个问题 Running TestSuite log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies). log4j:WARN Please initiali

我正在远程webdrivers上执行一个SeleniumWebDriversMaven项目,每次运行它时,实际的测试用例都会通过,但由于以下错误,构建失败

这是我的运行控制台的输出。请有人帮我解决这个问题

Running TestSuite
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Oct 02, 2014 1:03:47 PM com.test.perioddelay.Log info
INFO: ##################################
Oct 02, 2014 1:03:47 PM com.test.perioddelay.Log info
INFO: This is Silverscreentest-men
Maximize the browser-window
Wait for 6 seconds
Wait for 6 seconds
Click on order now- period delay
Confirm checkbox is pre-selected
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Switch to frame
Wait for 6 seconds
Wait for 6 seconds
Wait for 6 seconds
Take screenshot
Wait for 6 seconds
Oct 02, 2014 1:05:04 PM com.test.perioddelay.Log info
INFO: ##################################
Oct 02, 2014 1:05:04 PM com.test.perioddelay.Log info
INFO: This is Silverscreentest-men
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 120.671 sec

Results :

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

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:47.092s
[INFO] Finished at: Thu Oct 02 13:05:04 BST 2014
[INFO] Final Memory: 9M/122M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.1:test (default-test) on project com.test: Error occurred in starting fork, check output in log -> [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/MojoExecutionExc`enter code here`eption

Process finished with exit code 1
下面是我的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>perioddelay</groupId>
    <artifactId>com.test</artifactId>
    <version>1.0-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.42.2</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8.8</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12-beta-1</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>



        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>2.42.2</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.12.1</version>
                    <configuration>
                        <skipTests>false</skipTests>
                        <testFailureIgnore>true</testFailureIgnore>
                        <forkMode>once</forkMode>
                      <suiteXmlFiles>
                            <suiteXmlFile>src/main/resources/testng.xml</suiteXmlFile>
                        </suiteXmlFiles>
                    </configuration>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>






</project>

4.0.0
周期延迟
com.test
1.0-快照
org.seleniumhq.selenium
硒爪哇
2.42.2
org.testng
testng
6.8.8
朱尼特
朱尼特
4.12-beta-1
log4j
log4j
1.2.17
org.seleniumhq.selenium
硒服务器
2.42.2
编译
org.apache.maven.plugins
maven surefire插件
2.12.1
假的
真的
一旦
src/main/resources/testng.xml

尝试删除forkMode配置属性。转到最新版本的surefire。

您实际运行的是什么命令?为什么使用maven surefire插件进行集成测试。对于集成测试,maven failsafe插件是更好的选择。嗨,Kkuilla,我运行的命令只是普通的maven命令,它是干净的编译测试。我的pom中没有故障保护插件。我应该添加它并尝试一下吗?可能没有关系,但为什么要使用如此旧版本的
maven surefire plugin
?那是因为我尝试了stackoverflow中发布的一些解决方案。因此,低版本。我甚至尝试过2.17,但没有luckCan你告诉我在哪里可以找到它,以便我删除它?嗨,我认为这个问题是根据你的建议解决的。我删除了fork mode属性,如下所示-:我已经为这个问题挣扎了一天多了,非常感谢您的建议。