1.更新源列表
sudo apt update
2.安装
sudo apt install maven
3.验证
mvn -v
4.配置阿里源
用下列setting文件替换/usr/share/maven/conf下的settings.xml
<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<pluginGroups> </pluginGroups> <proxies> </proxies> <servers>
</servers> <mirrors> <mirror> <id>aliyun</id> <mirrorOf>*</mirrorOf> <name>aliyun</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors> <profiles> </settings><!-- Another sample, using keys to authenticate. <server> <id>siteServer</id> <privateKey>/path/to/private/key</privateKey> <passphrase>optional; leave empty if not used.</passphrase> </server> -->
版权归原作者 不爱开发的干饭人 所有, 如有侵权,请联系我们删除。