1

I need to import the org.geotools.util.factory.GeoTools

import org.geotools.util.factory.GeoTools;

but the compiler has issues finding the import. I set up my project using maven with the following dependencies:

<properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <gt.version>20.0</gt.version>  <!-- change to GeoTools version -->
     <gs.version>2.14.0</gs.version>  <!-- change to GeoServer version -->
   </properties>

  <dependencies>
     <dependency>
       <groupId>org.geotools</groupId>
       <artifactId>gt-process</artifactId>
       <version>${gt.version}</version>
     </dependency>
     <dependency>
       <groupId>org.geoserver.extension</groupId>
       <artifactId>gs-wps-core</artifactId>
       <version>${gs.version}</version>
     </dependency>
     <dependency>
       <groupId>org.geoserver</groupId>
       <artifactId>gs-main</artifactId>
       <version>${gs.version}</version>
       <classifier>tests</classifier>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>4.11</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>com.mockrunner</groupId>
       <artifactId>mockrunner</artifactId>
       <version>0.3.6</version>
      <scope>test</scope>
     </dependency>
     <dependency>
        <groupId>org.locationtech.jts</groupId>
        <artifactId>jts-core</artifactId>
        <version>1.15.0</version>
    </dependency>
     <dependency>
        <groupId>org.opengis</groupId>
        <artifactId>geoapi</artifactId>
        <version>3.0.0</version>
    </dependency>
   </dependencies>

My project also makes use of import org.geotools.util.logging.Logging; and this works. All other imports work good. This is the only one that fails. Unfortunately googling didn't help me. Is this a version issue? Is this import renamed or deprecated? What can I do?

1

I believe that class is at org.geotools.factory.GeoTools in all versions prior to the master branch, where it has been moved.

I suspect you are mixing and matching between stable and latest documents, unless you are using GeoTools version 20-SNAPSHOT (or later) you should look at stable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.