薄荷加冰丶 2019-12-31 09:17 采纳率: 50%
浏览 885
已采纳

Jenkins打包项目报错,JDK1.8

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.400 s
[INFO] Finished at: 2019-12-31T17:08:37+08:00
[INFO] Final Memory: 32M/117M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project cmdbunion_eureka: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile: org/codehaus/plexus/compiler/util/scan/InclusionScanException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/DATA/repo/repository/org/apache/maven/plugins/maven-compiler-plugin/3.8.1/maven-compiler-plugin-3.8.1.jar
[ERROR] urls[1] = file:/DATA/repo/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[JENKINS] Archiving /DATA/var/lib/jenkins/workspace/cmdbunion_parent/cmdbunion_eureka/pom.xml to com.travelsky/cmdbunion_eureka/0.0.1-SNAPSHOT/cmdbunion_eureka-0.0.1-SNAPSHOT.pom
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.codehaus.plexus.compiler.util.scan.InclusionScanException
[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.
[JENKINS] Archiving /DATA/var/lib/jenkins/workspace/cmdbunion_parent/cmdbunion_titsm/pom.xml to com.travelsky/cmdbunion_titsm/0.0.1-SNAPSHOT/cmdbunion_titsm-0.0.1-SNAPSHOT.pom
[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/PluginContainerException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cmdbunion_eureka

图片说明

图片说明

  • 写回答

2条回答 默认 最新

  • 程序员的救赎 2019-12-31 11:58
    关注

    你需要在jenkins的运行build的命令配置里增加-X参数,就像下面,来获取更多的报错信息,其他信息看不到。

    clean install package -x -Dmaven.test.skip=true -Pprod
    

    我从错误信息里看到了缺少class

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project cmdbunion_eureka: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile: org/codehaus/plexus/compiler/util/scan/InclusionScanException
    

    有可能是这两个文件损坏了

    [ERROR] urls[0] = file:/DATA/repo/repository/org/apache/maven/plugins/maven-compiler-plugin/3.8.1/maven-compiler-plugin-3.8.1.jar
    [ERROR] urls[1] = file:/DATA/repo/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
    

    建议你把jenkins服务的目录/DATA/repo/repository/下的关于/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jarorg/apache/maven/plugins/maven-compiler-plugin/3.8.1/maven-compiler-plugin-3.8.1.jar删除掉,重新执行jenkins任务,它会重新下载新的依赖。

    但是更多信息应该给mvn参数加上-x打开调试信息

    另外你设置了两个jdk,可能还跟你的mvn获取的jdk版本有关,查看你写代码时的jdk版本是不是跟maven给出的日志里的jdk版本是兼容的。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥100 如何快速统计出一亿行由0和1组成的数字里面的1连续出现几次及标记后出现的次数?
  • ¥15 include 头文件引用出错问题
  • ¥15 MATLAB并行池出问题
  • ¥15 本地运行成功上传到洛谷上却WA?
  • ¥15 断网的时候检测socket连接状态
  • ¥15 Jenkins执行bat指令时报错
  • ¥15 基于FPGA的算法实现
  • ¥15 在AST抽象语法图构建CFG图时 如何构建的
  • ¥15 关于#r语言#的问题:R语言GSVA函数调用失效q生信求解:这个GSVA的包,看了一下说是函数调用过期失效了,现在需要套用新模版公式,有没有解答的呀
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部