我的报错信息如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project ma-admin-web: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR]
[ERROR] Cannot find class in classpath: com.suning.ma.admin.rsf.impl.StmsRSFServiceImplTest
[ERROR] at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
[ERROR] at org.testng.xml.XmlClass.init(XmlClass.java:73)
[ERROR] at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
[ERROR] at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:544)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
[ERROR] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:745)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)
[ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
[ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:39)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10)
[ERROR] at org.testng.xml.Parser.parse(Parser.java:168)
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:311)
[ERROR] at org.testng.TestNG.run(TestNG.java:1030)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[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/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :ma-admin-web

maven 调用surefire执行单测的过程:

[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ imp-service-web ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent (instrument) @ imp-service-web ---
[INFO] argLine set to -javaagent:/data/.m2/org/jacoco/org.jacoco.agent/0.7.7.201606060606/org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=/data/jenkinsslave/workspace/imp1.5.7/imp-service-web/target/jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ imp-service-web ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 11 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ imp-service-web ---
[INFO] Compiling 141 source files to /data/jenkinsslave/workspace/imp1.5.7/imp-service-web/target/classes
17.127: [GC [PSYoungGen: 413134K->33277K(426496K)] 441207K->76068K(550400K), 0.0391110 secs] [Times: user=0.14 sys=0.04, real=0.04 secs]
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ imp-service-web ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ imp-service-web ---
[INFO] Compiling 2 source files to /data/jenkinsslave/workspace/imp1.5.7/imp-service-web/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ imp-service-web ---

先是clean -> jacoco agent -> maven-resources-plugin ->  maven-compiler-plugin -> maven-resources-plugin:testresource ->

maven-compiler-plugin:testCompile ->maven-surefire ->test run  jacoco-maven-plugin report -> maven-jar-plugin -> install

找不到test类,就是没有编译,在testresource compile no file compile to copy 到执行的单元测试目录下。

[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ma-admin-web ---
[INFO] Not compiling test sources

[ERROR] org.testng.TestNGException:Cannot find class in classpath:相关推荐

  1. org.testng.TestNGException: Cannot find class in classpath错误解决办法

    执行testng test出现下面的错误: org.testng.TestNGException: Cannot find class in classpath: interfacetest.test ...

  2. Testng 运行Cannot find class in classpath

    用Testng运行多个class,结果报: org.testng.TestNGException: Cannot find class in classpath: Salesman     at or ...

  3. org.testng.TestNGException: TestNG by default disables loading DTD from unsecured Urls.问题解决

    TestNG XML DTD错误 最近在tesgng跑测试用例时碰到了这个问题: org.testng.TestNGException: TestNG by default disables load ...

  4. Fatal Error: Unable to find package java.lang in classpath or bootclasspath

    前言 centos 7.6 jdk 1.8 maven 3.6.3 报错 Fatal Error: Unable to find package java.lang in classpath or b ...

  5. Eclipse中使用git提交代码,报错Testng 运行Cannot find class in classpath的解决方案

    一.查找原因方式 1.点击Project-->Clear...-->Build Automatically 2.查看问题 二.报错因素 1.提交.xlsx文件 2.提交时,.xlsx文件被 ...

  6. [testng]Cannot find class in classpath

    初学selenium,运行用例时报错如下: org.testng.TestNGException:  Cannot find class in classpath: Salesman     at o ...

  7. IntelliJ IDEA 执行testng 报错Cannot find class in classpath 的解决办法

    工程里有很多的单元测试,但由于维护不周,很多单元测试的代码已经不能执行,并且有编译报错,但在Eclipse下其实还是能执行单元测试的,到了IDEA中就无法执行,RUN的时候报错如下: org.test ...

  8. 第一次运行TestNG测试类时报Cannot find class in classpath

    第一次运行TestNG测试类时报以下的错误,其实我在公司也遇到这个问题,但2次出问题的原因不一样,我记录一下吧 . org.testng.TestNGException: Cannot find cl ...

  9. 执行mvn test命令后报:Cannot find class in classpath

    问题描述: [ERROR] There are test failures.Please refer to /Users/mac/Documents/GitHub/ApiTestV1/target/s ...

最新文章

  1. oracle的server_name,配置Oracle Name Server的完全步骤
  2. 2017年第八届蓝桥杯 —— 训练题目 —— 空瓶换汽水
  3. [BUUCTF-pwn]——[BJDCTF 2nd]test
  4. Wannafly挑战赛18
  5. Threejs性能监视和可视化控制
  6. 创建预编译头 Debug 正常 Release Link Error:预编译头已存在,使用第一个 PCH
  7. Gradle+IDEA使用说明
  8. jfinal 获取路径
  9. warning:setlocale:LC_CTYPE:cannot change locale
  10. cactus java_Cactus入门
  11. 美国在线教育的启示:教育领域正在革命
  12. unity3d改变物体的中心位置_Unity3d粒子特效:制作火焰效果
  13. 基于ETest的飞控系统半实物实时仿真
  14. java cnzz_cnzz 模拟请求登录(传入url get data ) demo
  15. 计算机与音乐,计算机音乐与midi
  16. 生产订单(prod order)状态直接从表(AUFK/JEST/TJ02T/TJ02)获取
  17. linux的dve界面如何debug,VCS课时3:使用DVE进行Debug
  18. Camera Hal OEM模块 ---- cmr_grab.c
  19. 刚写完的 基于微信的房产中介预约看房小程序 毕业设计毕设源码
  20. [初学Spring Boot](1):打不开localhost:8080/hello

热门文章

  1. python解释器下安装z3_再次:在Windows上安装Z3 Python
  2. sqlserver存储过程入门之 游标
  3. 学校计算机教学演示,案例演示在计算机基础教学中的运用
  4. 字符流---IO学习笔记(三)
  5. 服务器防渗透(1)--信息收集
  6. String与string的区别
  7. 关于64位Linux编译hadoop2
  8. python学习笔记三 pickle序列化
  9. 解决CI框架的Disallowed Key Characters错误提示
  10. djano 模型查询