为什么我不能解决GeoTools maven quickstart的依赖关系? [英] Why can't I resolve the dependencies for GeoTools maven quickstart?

查看:287
本文介绍了为什么我不能解决GeoTools maven quickstart的依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

POM是

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.geotools</groupId>
    <artifactId>tutorial</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>tutorial</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <geotools.version>10-SNAPSHOT</geotools.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-shapefile</artifactId>
            <version>${geotools.version}</version>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-swing</artifactId>
            <version>${geotools.version}</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>maven2-repository.dev.java.net</id>
            <name>Java.net repository</name>
            <url>http://download.java.net/maven/2</url>
        </repository>
        <repository>
            <id>osgeo</id>
            <name>Open Source Geospatial Foundation Repository</name>
            <url>http://download.osgeo.org/webdav/geotools/</url>
        </repository>
    </repositories>
</project>

我得到了错误:

[ERROR] Failed to execute goal on project tutorial: Could not resolve dependencies for project org.geotools:tutorial:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: org.geotools:gt-shapefile:jar:10-SNAPSHOT, org.geotools:gt-swing:jar:10-SNAPSHOT: Could not find artifact org.geotools:gt-shapefile:jar:10-SNAPSHOT in maven2- repository.dev.java.net (http://download.java.net/maven/2) -> [Help 1]

为什么它不能解决工件. GeoTools还有其他说明(我无法上班),但我想知道这有什么问题.

Why can't it resolve the artifacts. GeoTools has other instructions (which I can't get to work) but I'd like to know whats wrong with this.

谢谢

推荐答案

之所以会出现此问题,是因为org.geotools:gt-shapefile:jar:10-SNAPSHOThttp://download.java.net/maven/2http://download.osgeo.org/webdav/geotools上都不存在.您所要做的就是为GeoTools定义snapshot repository,如 GeoTools:Maven快速入门,如下所示:-

The issue occurs because the org.geotools:gt-shapefile:jar:10-SNAPSHOT does not exist at either http://download.java.net/maven/2 or http://download.osgeo.org/webdav/geotools. All you have to do is define the snapshot repository for the GeoTools as it is mentioned at the GeoTools:Maven Quick Start as the following: -

<repositories>
    <repository>
        <id>maven2-repository.dev.java.net</id>
        <name>Java.net repository</name>
        <url>http://download.java.net/maven/2</url>
    </repository>
    <repository>
        <id>osgeo</id>
        <name>Open Source Geospatial Foundation Repository</name>
        <url>http://download.osgeo.org/webdav/geotools/</url>
    </repository>
    <repository> <!--Add the snapshot repository here-->
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <id>opengeo</id>
        <name>OpenGeo Maven Repository</name>
        <url>http://repo.opengeo.org</url>
    </repository>
</repositories>

我希望这会有所帮助.

这篇关于为什么我不能解决GeoTools maven quickstart的依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆