简体   繁体   English

org.apache.maven.lifecycle.LifecycleExecutionException:无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test

[英]org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test

I am new to Selenium Testing. 我是硒测试的新手。 While I am trying to build my project, I am getting the below error. 在尝试构建项目时,出现以下错误。 I tried searching through the stack overflow questions multiple times, but not able to figure out an actual solution to my issue. 我尝试多次搜索堆栈溢出问题,但无法找出解决我问题的实际方法。

Sharing my pom.xml below: 在下面共享我的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>WebDriverTest</groupId>
    <artifactId>WebDriverTest</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.20</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-api</artifactId>
            <version>2.20</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.1</version>
        </dependency>
    </dependencies>
    <!-- <build> <plugins> <plugin> <groupId>org.apache.maven.plugin</groupId> 
        <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> 
        </plugin> </plugins> </build> -->
</project>

The exception trace I am receiving is shown below 我收到的异常跟踪如下所示

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project WebDriverTest: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project WebDriverTest: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more
Caused by: java.lang.RuntimeException: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
    at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.close(ForkClient.java:257)
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:301)
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:116)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:740)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAllProviders(AbstractSurefireMojo.java:682)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:648)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:586)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    ... 21 more

I suspect another reason for my build failure was that one of my jars was corrupt. 我怀疑构建失败的另一个原因是我的一个罐子损坏了。 I was getting an exception "invalid LOC header (bad signature)" for org.testng.testng jar inside .m2 folder. 我在.m2文件夹内的org.testng.testng jar出现异常“无效的LOC标头(错误签名)”。 I deleted the jar, and ran the maven build again. 我删除了jar,然后再次运行Maven构建。 And the project became success. 项目成功了。

A part of build trace is given below: 下面给出了一部分构建跟踪:

[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ WebDriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ WebDriverTest ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ WebDriverTest ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\celin\eclipse-workspace\WebDriverTest\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ WebDriverTest ---
[INFO] Surefire report directory: C:\Users\celin\eclipse-workspace\WebDriverTest\target\surefire-reports

暂无
暂无

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

相关问题 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test 未能执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test testng meaven - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test testng meaven org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1 - org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test(default-test) - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test on project XYZ - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test on project XYZ 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.10:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.16:SAKAI中的测试错误 - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test error in SAKAI 未能执行目标 org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test DevOps - Maven: org.apache.maven.lifecycle.LifecycleExecutionException: 无法执行目标 org.apache.maven.plugins:maven-war-plugin:2.6:war - DevOps - Maven: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM