【TIPS】在maven项目中配置仓库后找不到依赖的解决办法

【TIPS】在maven项目中配置仓库后找不到依赖的解决办法

  • 找不到geotools依赖
  • 解决

找不到geotools依赖

在项目中添加了项目的geotools依赖,但是却找不到geotools,发现是阿里云maven镜像上面没有这个包,所以需要从其他的镜像中获取。
【TIPS】在maven项目中配置仓库后找不到依赖的解决办法_第1张图片

解决

所以需要在pom中配置其他镜像,这里我配置了osgeo的镜像:


    
        osgeo
        OSGeo Release Repository
        https://repo.osgeo.org/repository/release/
        
            true
        
        
            true
        
    



    
        osgeo
        OSGeo Release Repository
        https://repo.osgeo.org/repository/release/
        
            true
        
    


但是,刷新之后还是找不到geotools,这时,需要修改maven中setting.xml配置文件mirrorOf标签的配置,需要修改为如下,表示先从id为osgeo的镜像中查找,如果查找不到再从默认的阿里云镜像中查找:

	
		aliyun
		aliyun Maven
		*,!osgeo
		http://maven.aliyun.com/nexus/content/groups/public/
	

你可能感兴趣的:(Java,GIS,java,maven)