在Maven中运行Geo Tools时出现“无法找到类符号”错误

时间:2013-11-13 11:39:25

标签: java maven svn geotools

我是使用Geo Tools和Maven的新手。我正在按照教程进行操作并遇到了一个特定的错误。我正在尝试运行的代码可用here

我的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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.geotools</groupId>
  <artifactId>tutorial</artifactId>
  <packaging>jar</packaging>
  <version>10.0-SNAPSHOT</version>
  <name>tutorial</name>
  <url>http://maven.apache.org</url>
  <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <geotools.version>10.1</geotools.version>
    </properties>
    <build>
     <defaultGoal>install</defaultGoal>
     <plugins>
          <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
               </configuration>
          </plugin>
      </plugins>
</build>
  <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>
        <dependency>
           <groupId>org.geotools</groupId>
           <artifactId>gt-grid</artifactId>
           <version>${geotools.version}</version>
        </dependency>
        <dependency>
           <groupId>org.geotools</groupId>
           <artifactId>gt-epsg-hsql</artifactId>
           <version>${geotools.version}</version>
        </dependency>
        <dependency>
        <groupId>gov.nist.math</groupId>
        <artifactId>jama</artifactId>
        <version>1.0.2</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>
    <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>
</project>

正如我所提到的,我正在尝试运行上述链接中提供的相同代码。

我收到的错误是:

line 122: cannot find symbol
  symbol:   class IntersectionBuilder
  location: class org.geotools.grid.GridExamples

是否缺课?任何帮助都将受到高度赞赏。

1 个答案:

答案 0 :(得分:0)

我自己使用gevenools和maven相当新,并且最近遇到了类似的问题。如果我没有弄错的话,gt-grid是一个不受支持的模块。因此,您可能需要下载源代码并构建它以便使用它。我似乎无法在http://svn.osgeo.org/geotools/tags/post-migration/modules/unsupported/grid/src/main/java/org/geotools/grid/

找到GridExamples类