Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/68.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 未能执行目标org.apache.maven.plugins:maven surefire plugin:3.0.0-M3:test_Java_Maven_Selenium_Maven Surefire Plugin - Fatal编程技术网

Java 未能执行目标org.apache.maven.plugins:maven surefire plugin:3.0.0-M3:test

Java 未能执行目标org.apache.maven.plugins:maven surefire plugin:3.0.0-M3:test,java,maven,selenium,maven-surefire-plugin,Java,Maven,Selenium,Maven Surefire Plugin,我正在尝试用JAVA学习Selemnium。当我使用命令“mvn test”时,我遇到了以下错误。 未能执行目标org.apache.maven.plugins:maven surefire plugin:3.0.0-M3:test <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="htt

我正在尝试用JAVA学习Selemnium。当我使用命令“mvn test”时,我遇到了以下错误。 未能执行目标org.apache.maven.plugins:maven surefire plugin:3.0.0-M3:test

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.tchateau.mavenTest</groupId>
  <artifactId>TestMaven</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>TestMaven</name>
  <url>http://maven.apache.org</url>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M3</version>
            <configuration>
              <suiteXmlFiles>
                <suiteXmlFile>testng.xml</suiteXmlFile>
              </suiteXmlFiles>
            </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencies>

    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.testng/testng -->
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured -->
    <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>3.0.5</version>
        <scope>test</scope>
    </dependency>

        <!-- https://mvnrepository.com/artifact/io.appium/java-client -->
    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>5.0.4</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.13.2</version>
        <scope>test</scope>
    </dependency>
  </dependencies>

</project>

C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven
λ mvn test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.tchateau.mavenTest:TestMaven >------------------
[INFO] Building TestMaven 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ TestMaven ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ TestMaven ---
[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\tchateau\Documents\workspace\mavenWorkspace\TestMaven\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ TestMaven ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ TestMaven ---
[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 3 source files to C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) @ TestMaven ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.386 s
[INFO] Finished at: 2019-10-29T09:54:36+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (default-test) on project TestMaven: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:657)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:283)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:246)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1161)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1002)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:848)
[ERROR]         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR]         at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR]         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR]         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
[ERROR]         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR]         at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
[ERROR]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR]
[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/MojoExecutionException

4.0.0
org.tchateau.mavenTest
TestMaven
罐子
1.0-快照
TestMaven
http://maven.apache.org
org.apache.maven.plugins
maven surefire插件
3.0.0-M3
testng.xml
org.seleniumhq.selenium
硒爪哇
3.141.59
org.testng
testng
6.14.3
测试
放心吧
放心
3.0.5
测试
木卫一
java客户端
5.0.4
org.assertj
assertj核心
3.13.2
测试
C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven
λmvn检验
[信息]正在扫描项目。。。
[信息]
[信息]--------------------------------
[信息]构建TestMaven 1.0-SNAPSHOT
[信息]------------------------------------[jar]---------------------------------
[信息]
[信息]---maven资源插件:2.6:resources(默认资源)@TestMaven---
[警告]使用平台编码(实际上是Cp1252)复制过滤后的资源,即构建依赖于平台!
[信息]跳过不存在的资源目录C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\src\main\resources
[信息]
[信息]---maven编译器插件:3.1:compile(默认编译)@TestMaven---
[信息]检测到更改-重新编译模块!
[警告]尚未使用平台编码Cp1252设置文件编码,即生成依赖于平台!
[INFO]正在将1个源文件编译为C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\target\classes
[信息]
[信息]---maven资源插件:2.6:testResources(默认testResources)@TestMaven---
[警告]使用平台编码(实际上是Cp1252)复制过滤后的资源,即构建依赖于平台!
[信息]跳过不存在的资源目录C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\src\test\resources
[信息]
[信息]---maven编译器插件:3.1:testCompile(默认testCompile)@TestMaven---
[信息]检测到更改-重新编译模块!
[警告]尚未使用平台编码Cp1252设置文件编码,即生成依赖于平台!
[INFO]正在将3个源文件编译为C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\target\testclasses
[信息]
[信息]---maven surefire插件:3.0.0-M3:test(默认测试)@TestMaven---
[信息]
[信息]-------------------------------------------------------
[信息]
[信息]-------------------------------------------------------
[信息]正在运行TestSuite
[信息]
[信息]结果:
[信息]
[信息]测试运行:0,失败:0,错误:0,跳过:0
[信息]
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:7.386秒
[信息]完成时间:2019-10-29T09:54:36+01:00
[信息]------------------------------------------------------------------------
[错误]无法在项目TestMaven上执行目标org.apache.maven.plugins:maven surefire plugin:3.0.0-M3:test(默认测试):存在测试失败。
[错误]
[错误]请参阅C:\Users\tchateau\Documents\workspace\mavenWorkspace\TestMaven\target\surefire报告以了解各个测试结果。
[错误]请参考转储文件(如果存在)[date]。转储,[date]-jvmRun[N]。转储和[date]。转储流。
[错误]分叉进程中出现错误
[错误]sun.security.provider.certpath.SunCertPathBuilderException:找不到请求目标的有效证书路径
[错误]org.apache.maven.surefire.booter.SurefireBooterWorkException:分叉进程中出现错误
[错误]sun.security.provider.certpath.SunCertPathBuilderException:找不到请求目标的有效证书路径
[错误]位于org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:657)
[错误]位于org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:283)
[错误]位于org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:246)
[错误]位于org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1161)
[错误]位于org.apache.maven.plugin.surefire.AbstractSurefireMojo.ExecuteAfterPremissionSchecked(AbstractSurefireMojo.java:1002)
[错误]位于org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:848)
[错误]位于org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[错误]位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[错误]位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[错误]位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[错误]位于org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[错误]位于org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[错误]位于org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[错误]位于org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[错误]位于org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[错误]位于org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[错误]
mvn clean install -U -Dmaven.test.failure.ignore=true
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Suite">
  <test thread-count="5" name="Test">
    <classes>
      <class name="org.tchateau.mavenTest.RESTAPITest"/>
      <class name="org.tchateau.mavenTest.SeleniumTest"/>
      <class name="org.tchateau.mavenTest.AppiumTest"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- Suite -->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<configuration>
    <testFailureIgnore>true</testFailureIgnore>
</configuration>