mac安装maven3.8.8

问题描述

down了一个新应用, maven依赖总是加载不到, 本地仓库也能找到, 项目启动报错

 

org.apache.skywalking:apm-toolkit-trace:pom:5.0.0-RC-SNAPSHOT failed to transfer from http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.skywalking:apm-toolkit-trace:pom:5.0.0-RC-SNAPSHOT from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [Lft-Local-Group (http://maven.lianjia.com/content/groups/Lft-Local-Group/, default, releases+snapshots), Lianjia-Local-Group (http://maven.lianjia.com/content/groups/Lianjia-Local-Group/, default, releases+snapshots), Bkjk-Provider-Group (http://maven.lianjia.com/content/groups/Bkjk-Provider-Group/, default, releases+snapshots)]

Since Maven 3.8.1 http repositories are blocked.

Possible solutions:
- Check that Maven settings.xml does not contain http repositories
- Check that Maven pom files do not contain http repository http://maven.lianjia.com/content/groups/Lft-Local-Group/
- Check that Maven pom files do not contain http repository http://maven.lianjia.com/content/groups/Lianjia-Local-Group/
- Check that Maven pom files do not contain http repository http://maven.lianjia.com/content/groups/Bkjk-Provider-Group/
- Add a mirror(s) for http://maven.lianjia.com/content/groups/Lft-Local-Group/, http://maven.lianjia.com/content/groups/Lianjia-Local-Group/, http://maven.lianjia.com/content/groups/Bkjk-Provider-Group/ that allows http url in the Maven settings.xml
- Downgrade Maven to version 3.8.1 or earlier in settings

 

本地maven版本是3.9.9 

解决方案

 

1.官网下载3.8.8 https://maven.apache.org/download.cgi

2.解压到目录 /Users/liangyadong001/maven/apache-maven-3.8.8

3.编辑配置

sudo vim ~/.bash_profile

 

4.新增配置

export MAVEN_HOME=/Users/liangyadong001/maven/apache-maven-3.8.8

export PATH=$MAVEN_HOME/bin:$PATH

 

5.使配置生效

source ~/.bash_profile

 

 6.验证版本

mvn -version

 

 

如果发现没生效, 重新打开一个终端窗口 mvn -version 再看看

 

posted @ 2024-11-19 20:38  习惯沉淀  阅读(45)  评论(0编辑  收藏  举报