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

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 19: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条)

报告相同问题?

悬赏问题

  • ¥30 Matlab打开默认名称带有/的光谱数据
  • ¥50 easyExcel模板 动态单元格合并列
  • ¥15 res.rows如何取值使用
  • ¥15 在odoo17开发环境中,怎么实现库存管理系统,或独立模块设计与AGV小车对接?开发方面应如何设计和开发?请详细解释MES或WMS在与AGV小车对接时需完成的设计和开发
  • ¥15 CSP算法实现EEG特征提取,哪一步错了?
  • ¥15 游戏盾如何溯源服务器真实ip?需要30个字。后面的字是凑数的
  • ¥15 vue3前端取消收藏的不会引用collectId
  • ¥15 delphi7 HMAC_SHA256方式加密
  • ¥15 关于#qt#的问题:我想实现qcustomplot完成坐标轴
  • ¥15 下列c语言代码为何输出了多余的空格