jenkins构建时出现报错1

在做jenkins时,创建一个项目并构建发布时出现了以下错误。

报错信息

Started by user jun
Running as SYSTEM
Building in workspace /root/.jenkins/workspace/seventeen
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --resolve-git-dir /root/.jenkins/workspace/seventeen/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://gitee.com/yangge666a/testweb # timeout=10
 ..........省略部分内容..................
 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project easy-springmvc-maven: Compilation failure: Compilation failure:
[ERROR] 不再支持源选项 6。请使用 7 或更高版本。
[ERROR] 不再支持目标选项 6。请使用 7 或更高版本。
[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
[JENKINS] Archiving /root/.jenkins/workspace/seventeen/pom.xml to springmvc-maven/easy-springmvc-maven/0.0.1-SNAPSHOT/easy-springmvc-maven-0.0.1-SNAPSHOT.pom
channel stopped
SSH: Connecting from host [bogon]
SSH: Connecting with configuration [test] ...
SSH: EXEC: completed after 5,216 ms
SSH: Disconnecting configuration [test] ...
SSH: Transferred 0 file(s)
Finished: FAILURE

原因及解决办法

由于我使用war安装Jenkins的版本是JDK17+maven3.8.7+tomcat8.5.84+jenkins2.346.3,所以根据报错原因可看出是版本不兼容造成的,JDK版本太高,更改JDK的版本。在此我重新配置了8版本的JDK。

[root@bogon java]# java -version
java version "1.8.0_351"
Java(TM) SE Runtime Environment (build 1.8.0_351-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.351-b10, mixed mode)

构建成功
在这里插入图片描述
注意查看显示BUILD SUCCESS,为构建成功,Transferred 1 file(s)为传输了一个文件,和最后Finished: SUCCESS为成功。有时候结果为Finished: SUCCESS,但是Transferred 0 file(s)说明没有把包传过去,也为失败。

.......省略内容..................
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.603 s
[INFO] Finished at: 2023-01-05T17:29:34+08:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /root/.jenkins/workspace/seventeen/pom.xml to springmvc-maven/easy-springmvc-maven/0.0.1-SNAPSHOT/easy-springmvc-maven-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/seventeen/target/easy-springmvc-maven.war to springmvc-maven/easy-springmvc-maven/0.0.1-SNAPSHOT/easy-springmvc-maven-0.0.1-SNAPSHOT.war
channel stopped
SSH: Connecting from host [bogon]
SSH: Connecting with configuration [test] ...
SSH: EXEC: completed after 202 ms
SSH: Disconnecting configuration [test] ...
SSH: Transferred 1 file(s)
Finished: SUCCESS
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值