美文网首页
Jenkins下编译maven项目出错

Jenkins下编译maven项目出错

作者: 雷神VeryYoung | 来源:发表于2018-06-04 10:29 被阅读0次

    Jenkins中编译出现如下错误:package org.testng does not exist,org.testng程序包不存在

    [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[13,18] package org.testng does not exist [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[14,18] package org.testng does not exist [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[15,18] package org.testng does not exist [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[16,18] package org.testng does not exist [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[17,18] package org.testng does not exist [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[22,35] cannot find symbol symbol: class ISuiteListener [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[27,29] cannot find symbol symbol: class ISuite location: class com.taobao.gulu.tools.xutest.WListener [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[32,30] cannot find symbol symbol: class ISuite location: class com.taobao.gulu.tools.xutest.WListener [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[26,9] method does not override or implement a method from a supertype [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[31,9] method does not override or implement a method from a supertype [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[41,29] cannot find symbol symbol: class ISuiteResult location: class com.taobao.gulu.tools.xutest.WListener [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[46,36] cannot find symbol symbol: class ISuiteResult location: class com.taobao.gulu.tools.xutest.WListener [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[47,25] cannot find symbol symbol: class ITestContext location: class com.taobao.gulu.tools.xutest.WListener [ERROR] /root/.jenkins/workspace/root/.jenkins/jobs/cloudDirector/src/main/java/com/taobao/gulu/tools/xutest/WListener.java:[48,30] cannot find symbol symbol: class ITestResult location: class com.taobao.gulu.tools.xutest.WListener

    解决方案:

    修改为:

    原因是:

    scope中值为test时,只参与测试相关的工作,包括测试代码的编译和执行,不会被打包,例如:JUnit、testng,另一种解决方案就是将方法写入到test相关的地方(src/test/java)。

    相关文章

      网友评论

          本文标题:Jenkins下编译maven项目出错

          本文链接:https://www.haomeiwen.com/subject/cpsesftx.html