5

I am trying to create a Web Processing Service with GeoServer. I used maven following opengeo instructions, and I get an eclipse project with a pom.xml file with dependencies like the following:

 <dependencies>
   <dependency>
     <groupId>org.geotools</groupId>
     <artifactId>gt-process</artifactId>
     <version>12-SNAPSHOT</version>
   </dependency>
   <dependency>
     <groupId>org.geotools</groupId>
     <artifactId>gt-geometry</artifactId>
     <version>12-SNAPSHOT</version>
   </dependency>
   ...
 </dependencies>

Now there is only a limited set of dependencies in the example. If I add other classes, I often get errors about class not being resolved. For example,

import org.geoserver.wps.WPSStorageCleaner;

or

import org.geotools.gce.geotiff.GeoTiffReader;

My question is, in general, where/how can I find out the correct values of <groupId>, <artifactId> etc. for classes like above? Is there a central registry for this kind of info?

I need to do this in maven, and not by otherwise fiddling with eclipse settings and the like. The closest thing I can find is at https://maven-repository.com/artifact/org.geoserver However, the versions there are at 1.x, and I don't know how to use the values there.

2

I gave up trying to find a maven repository to resolve the classes that geoserver's example POM file shows as well as a general way find either geotools or geoserver's correct current maven repository information when I ran into monstrosities such as this because I did not want to download / develop against all of geoserver's sources.

I ended up downloading the extension zip archive I wanted to develop against, the one whose contents you need to install into geoserver's webapps/geoserver/WEB-INF/lib directory to get geoserver to actually enable the extension.

Then, using this Can I add jars to maven 2 build classpath without installing them? solution, I put the extension jar files, e.g., gs-wps-core-2.7.0.jar, into a project lib directory and named it org.geoserver.extension.gs-wps-core-2.7.0.jar. Then I ran the install-to-project-repo.py script referenced in that answer to create the necessary project repo directory structure and the maven repository and dependency definitions:

<repository>
    <id>project</id>
    <url>file://${project.basedir}/repo</url>
</repository>

and

<dependency>
    <groupId>org.geoserver.extension</groupId>
    <artifactId>gs-wps-core</artifactId>
    <version>2.7.0</version>
</dependency>

No more maven complaints. Not an answer to the original question but maybe this will provide a pragmatic solution.

3
  • Jesus Christ man! I can't believe there is no way to discover it. Geotools maven support is very poor. I'm getting some examples around and it's a nightmare to find the correct dependencies to put in my POM file. – Magno C Jul 1 '16 at 12:26
  • I am not Him and I have since moved on from this issue. But one way to discover all the hidden dependencies, as well as dependencies that are actually unused, is with the Maven dependency plugin. I find the mvn dependency:tree analysis gives me the details that I am looking for. (Note the -Dverbose option.) – jwd630 Jul 1 '16 at 14:43
  • I don't know how this can solve the problem. Lets say we have a package import org.geotools.data.ows.CRSEnvelope in our class. How can I find the correct artifactId? Or worst just a WebMapServer wms = new WebMapServer(url) without any package information? – Magno C Jul 1 '16 at 15:06
0

For GeoTools modules you could try browsing the documentation which contains a list of the main modules and the extensions.

0

For now I'm playing in this site https://www.versioneye.com/search?lang=%2C&q=ows&g=org.geotools and do my best to find out

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.