0


Ubuntu中安装Maven

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>
<!-- 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>
 -->
</servers> <mirrors> <mirror> <id>aliyun</id> <mirrorOf>*</mirrorOf> <name>aliyun</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors> <profiles> </settings>
标签: ubuntu linux 运维

本文转载自: https://blog.csdn.net/weixin_48113578/article/details/141980918
版权归原作者 不爱开发的干饭人 所有, 如有侵权,请联系我们删除。

“Ubuntu中安装Maven”的评论:

还没有评论