maven pom依赖私库

maven pom依赖私库

有时候依赖某些jar包以后,pom文件会报错,表示找不到这个资源,可能这个资源已经不存在了,不过更有可能是这个资源不在中央库,这时候就需要指定远程库,也就是私库。

        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-geojson</artifactId>
            <version>12.0</version>
        </dependency>

比如上面用到的这个geotools,直接引入就会报错,需要加上以下这些

        <repository>
            <id>osgeo</id>
            <name>Open Source Geospatial Foundation Repository</name>
            <url>http://download.osgeo.org/webdav/geotools/</url>
        </repository>
  1. id:开源空间信息基金会简称,id是镜像的唯一标识
  2. name:仓库名
  3. url:镜像的url链接地址

猜你喜欢

转载自blog.csdn.net/m0_37659871/article/details/81034667