IntelliJ IDEA中的JTS拓扑套件

时间:2018-12-27 16:38:48

标签: java maven intellij-idea jts

我正尝试将JTS拓扑套件与ItelliJ(Java)结合使用,甚至无法运行简单的程序

我尝试使用此POM file,但是在修改POM文件时出现此错误:

Error:(1, 1) java: package org.locationtech.jts.geom does not exist

我什至尝试使用空类来丢弃其他问题:

import org.locationtech.jts.geom.*;

public class geo {}

我应该如何在项目中包含JTS?

1 个答案:

答案 0 :(得分:0)

我终于用这个POM文件完成了

<?xml version="1.0" encoding="UTF-8"?>
<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>as</groupId>
    <artifactId>a</artifactId>
    <version>1</version>
    <dependencies>
        <dependency>
            <groupId>org.locationtech.jts</groupId>
            <artifactId>jts-core</artifactId>
            <version>1.15.1</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>locationtech-releases</id>
            <url>https://repo.locationtech.org/content/groups/releases</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>jts-snapshots</id>
            <url>https://repo.locationtech.org/content/repositories/jts-snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>