一、 问题现象

org.pentaho:pentaho-aggdesigner-algorithm:pom:5.1.5-jhyde was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

在查看hive源码的时候 导入依赖的时候报 在 maven2仓库找不到

二、问题原因

原因就是在默认的中央仓库找不到类 pentaho-aggdesigner-algorithm:pom:5.1.5-jhyde,所以我们的思路是找到这个jar包的仓库地址,配置到maven setting.xml文件当中就可以解决了

三、解决问题

我们打开 maven 仓库 网站 https://mvnrepository.com/
搜索 pentaho-aggdesigner-algorithm:pom:5.1.5-jhyde

点击对应的版本号

这个时候会发现下面有一条Note 会写这个jar包在那个仓库当中

我们在 maven setting.xml 文件中 中把上面仓库的地址配置上即可解决问题

<profile> 
		<id>spring-plugin</id>   <!-- id 要唯一 -->
		<repositories> 
		  <repository> 
			<id>spring-plugin-1</id>  
			<url>https://repo.spring.io/plugins-release/</url>  
			<releases> 
			  <enabled>true</enabled> 
			</releases>  
			<snapshots> 
			  <enabled>true</enabled>  
			  <updatePolicy>always</updatePolicy> 
			</snapshots> 
		  </repository> 
		</repositories> 
</profile>
<!-- 注意要激活配置 -->
<activeProfiles>
	  <activeProfile>spring-plugin</activeProfile>
</activeProfiles>

四、总结

  1. 之前我都是遇到这种问题 google 一下,有可能尝试很多帖子的方案才解决,其实我们在遇到问题的时候要从根本上解决这个问题,所以按照这种方式,问题会很快解决了。
  2. 这个仓库的地址是海外的,在国内有可能网络不行,所以可以根据仓库的类型替换成国内的镜像,如阿里云。
  3. 切记配置多个mrrior标签,生效的只有一个仓库,只有第一个仓库无法访问的时候,才会使用第二个。但是仓库中没有你要找的包,他不会去访问第二个仓库!