0
点赞
收藏
分享

微信扫一扫

linux配置maven

捡历史的小木板 2024-05-25 阅读 17

1.将liunx版本的maven通过软件上传到linux服务器,并且解压:

tar -zxvf 压缩包 -C /xxx/xxx  // /xxx/xxx为路径  

2.在/etc/profile配置文件中配置环境变量:

vim /etc/profile

在profile文件中配置全局变量:

export MAVEN_HOME=/usr/local/apache-maven-3.5.4
export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH

让配置的环境变量生效:

source /etc/profile

修改maven的settings.xml配置文件,配置本地仓库地址:

cd /xxx/xxx/apache-maven-.../conf  

vim settings.xml

修改内容如下:

<localRepository>本地仓库地址</localRepository>   //增加本地仓库

<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror> //添加阿里仓库
举报

相关推荐

0 条评论