CentOS-7yum安装maven
CentOS -7设置为 阿里云yum源
rm -rf /etc/yum.repos.d/*
curl -o /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
安装maven
yum -y install maven
配置maven
vi /etc/maven/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:\dev_mavenRepository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
</profiles>
</settings>
然后就可以使用maven了
本文档详细介绍了如何在CentOS-7系统中设置阿里云yum源,并通过yum命令安装Maven。首先,清除原有yum源,然后替换为阿里云镜像。接着,执行yum命令安装Maven。最后,配置Maven的settings.xml文件,将中央仓库镜像指向阿里云,以便加速下载。现在,您已成功在CentOS-7上安装并配置好Maven,可以愉快地使用了。
1258

被折叠的 条评论
为什么被折叠?



