gpt4 book ai didi

java - Geotools 快速入门包 org.geotools 不存在

转载 作者:太空宇宙 更新时间:2023-11-04 12:56:02 26 4
gpt4 key购买 nike

我也是 Geotools 和 Maven 的新手。我尝试了快速入门来开始使用地理工具,一切都运行良好,直到我尝试创建示例应用程序。所有以 org.geotools 开头的导入都被标记为不存在。查找依赖项显示没有匹配项。这种情况在 Netbeans 和 Eclipse 中都会发生,显然我做错了什么。

在 Netbeans 中,我进行了清理和构建,得到了以下结果:

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:13.2, org.geotools:gt-swing:jar:13.2: Could not find artifact org.geotools:gt-shapefile:jar:13.2 in central (http://repo.maven.apache.org/maven2) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

有人可以帮忙吗?

使用 java 1.8.0.73、Netbeans 8.1、Eclipse 4.5.1 和 Geotools 版本 13.2。我使用 14.2 版本遇到了同样的错误。

更新pom.xml 文件如下所示。

<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>13.2</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>

最佳答案

我无法发表评论,所以这就是我在这里回答的原因。你能给我们看看 pom.xml 吗?另外,您是否运行了mvn clean install?执行此命令后,pom 中的所有库都应该被下载,并且应该存在。

关于java - Geotools 快速入门包 org.geotools 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35381422/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com