maven构建失败

maven 构建失败

[root@loaclhost jdbc-pool]# mvn clean package -DskipTests
[INFO] Scanning for projects...
Downloading: https://maven.aliyun.com/repository/public/org/apache/apache/34/apache-34.pom
Downloaded: https://maven.aliyun.com/repository/public/org/apache/apache/34/apache-34.pom (24 KB at 23.1 KB/sec)
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building jdbc-pool 1.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://maven.aliyun.com/repository/public/org/apache/maven/plugins/maven-remote-resources-plugin/3.3.0/maven-remote-resources-plugin-3.3.0.pom
Downloaded: https://maven.aliyun.com/repository/public/org/apache/maven/plugins/maven-remote-resources-plugin/3.3.0/maven-remote-resources-plugin-3.3.0.pom (15 KB at 47.1 KB/sec)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.4.1:clean (default-clean) on project tomcat-jdbc: The plugin org.apache.maven.plugins:maven-clean-plugin:3.4.1 requires Maven version 3.6.3 -> [Help 1]   #显示需要3.6.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/PluginIncompatibleException
[root@loaclhost jdbc-pool]# mvn -version
Apache Maven 3.0.5 (Red Hat 3.0.5-17)
Maven home: /usr/share/maven
Java version: 11.0.23, vendor: Red Hat, Inc.
Java home: /usr/lib/jvm/java-11-openjdk-11.0.23.0.9-2.el7_9.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.119.1.el7.x86_64", arch: "amd64", family: "unix"
下载高版本的maven

[root@loaclhost ~]# wget https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
--2025-04-11 00:43:13--  https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
Resolving dlcdn.apache.org (dlcdn.apache.org)... 151.101.2.132, 2a04:4e42::644
Connecting to dlcdn.apache.org (dlcdn.apache.org)|151.101.2.132|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9410508 (9.0M) [application/x-gzip]
Saving to: ‘apache-maven-3.9.6-bin.tar.gz’

100%[=================================================================================================================================>] 9,410,508   49.5KB/s   in 3m 52s 

2025-04-11 00:47:07 (39.6 KB/s) - ‘apache-maven-3.9.6-bin.tar.gz’ saved [9410508/9410508]

[root@loaclhost ~]# tar -zxvf apache-maven-3.9.6-bin.tar.gz -C /opt



添加环境变量
[root@loaclhost ~]# cat .bashrc 
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.23.0.9-2.el7_9.x86_64
export PATH=$JAVA_HOME/bin:$PATH
export MAVEN_HOME=/opt/apache-maven-3.9.6
export PATH=$MAVEN_HOME/bin:$PATH
[root@loaclhost ~]# source ~/.bashrc

最后重新编译 查看版本
[root@loaclhost ~]# mvn clean package -DskipTests
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值