首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未能在项目自动化上执行目标org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (默认测试):有测试失败

未能在项目自动化上执行目标org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (默认测试):有测试失败
EN

Stack Overflow用户
提问于 2019-03-14 17:32:18
回答 1查看 1.1K关注 0票数 0

无法使用: mvn -Dtest=SettingsTest#test*测试运行单个测试

我遵循了这里提到的步骤:https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

它抛出一个错误:

代码语言:javascript
复制
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.225 s
[INFO] Finished at: 2019-03-14T11:00:10-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (default-test) on project automation: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/iOS-automation/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] -> [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

我的pom.xml:

代码语言:javascript
复制
<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>org.abc</groupId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>automation</name>
  <description>iOS app automation</description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <build>
      <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>3.0.0-M3</version>
              <configuration>
				  <suiteXmlFiles>
                      <suiteXmlFile>parth.xml</suiteXmlFile>
                  </suiteXmlFiles>
			  </configuration>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.5.1</version>
              <configuration>
                  <source>1.8</source>
                  <target>1.8</target>
              </configuration>
          </plugin>
      </plugins>
  </build>
  
  <dependencies>
    <dependency>
      	<groupId>junit</groupId>
     	<artifactId>junit</artifactId>
      	<version>3.8.1</version>
      	<scope>test</scope>
    </dependency>
    <dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-java</artifactId>
		<version>2.47.1</version>
	</dependency>
	<dependency>
		<groupId>io.appium</groupId>
		<artifactId>java-client</artifactId>
		<version>4.1.2</version>
	</dependency>
	<dependency>
		<groupId>com.google.code.gson</groupId>
		<artifactId>gson</artifactId>
		<version>2.3.1</version>
	</dependency>
	<dependency>
	  <groupId>org.testng</groupId>
	  <artifactId>testng</artifactId>
	  <version>6.8</version>
      <scope>compile</scope>
	</dependency>
	<dependency>
		<groupId>com.google.googlejavaformat</groupId>
		<artifactId>google-java-format</artifactId>
		<version>1.5</version>
	</dependency>
	  <dependency>
		  <groupId>org.json</groupId>
		  <artifactId>json</artifactId>
		  <version>20180813</version>
	  </dependency>
	  <dependency>
		  <groupId>com.sun.jersey.contribs</groupId>
		  <artifactId>jersey-apache-client</artifactId>
		  <version>1.19.4</version>
	  </dependency>
	  <dependency>
		  <groupId>org.glassfish.jersey.core</groupId>
		  <artifactId>jersey-client</artifactId>
		  <version>2.27</version>
	  </dependency>
  </dependencies>
  <artifactId>automation</artifactId>
</project>

所有其他命令,如: mvn干净安装,mvn干净编译工作良好。

我的pom.xml中有什么问题或者设置有什么问题吗?

EN

回答 1

Stack Overflow用户

发布于 2019-03-15 06:32:59

你在你的项目中使用了插件吗?正如下面的文章所提到的,这个异常不是来自maven,它是从插件https://cwiki.apache.org//confluence/display/MAVEN/MojoFailureException生成的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55168744

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档