5

I am following this example

https://docs.geoserver.org/latest/en/developer/programming-guide/wps-services/implementing.html

To create a custom GeoServer WPS. I am trying to build the project using

mvn clean install

But the build fails with the following error:

[ERROR] Failed to execute goal on project hello_wps: 
Could not resolve dependencies for project org.geoserver:hello_wps:jar:2.8-SNAPSHOT: 
Failed to collect dependencies at org.geotools:gt-process:jar:14-SNAPSHOT: 
Failed to read artifact descriptor for org.geotools:gt-process:jar:14-SNAPSHOT: 
Could not transfer artifact org.geotools:gt-process:pom:14-SNAPSHOT from/to boundless (https://repo.boundlessgeo.com/main): 
Transfer failed for https://repo.boundlessgeo.com/main/org/geotools/gt-process/14-SNAPSHOT/gt-process-14-SNAPSHOT.pom: 
Unknown host repo.boundlessgeo.com

I have tried to change the GeoTools version to the latest version 24-SNAPSHOT, but the same error occurred.

2 Answers 2

7

The repository moved, and we were unable to get maven to handle a redirect.

See the GeoTools Blog for more details.

So now you need this in your pom.xml files:

<repositories>
  <repository>
    <id>osgeo</id>
    <name>OSGeo Release Repository</name>
    <url>https://repo.osgeo.org/repository/release/</url>
    <snapshots><enabled>false</enabled></snapshots>
    <releases><enabled>true</enabled></releases>
  </repository>
</repositories>

Or you can add this to your ~/.m2/settings.xml file:

<mirrors>
  <mirror>
    <id>osgeo-release</id>
    <name>OSGeo Repository</name>
    <url>https://repo.osgeo.org/repository/release/</url>
    <mirrorOf>osgeo</mirrorOf>
  </mirror>
  <mirror>
    <id>geoserver-releases</id>
    <name>Boundless Repository</name>
    <url>https://repo.osgeo.org/repository/Geoserver-releases/</url>
    <mirrorOf>boundless</mirrorOf>
  </mirror>
</mirrors>
6
  • 1
    Thanks Ian for your help. It seems that this new repository doesn't have the old releases of GeoTools and GeoServer. Actually I have some old custom WPSs that I was building against GeoTools version 19-SNAPSHOT and GeoServer version 2.12.1. Now I tried your new repository but it failed to build. When I change the versions to GeoTools 24-SNAPSHOT and GeoServer 2.18-SNAPSHOT, the build gives the following errors: package com.vividsolutions.jts.geom does not exist package com.vividsolutions.jts.io does not exist
    – soso
    Apr 17, 2020 at 11:26
  • check out the upgrade faq for all the changes you need to go from 19 to 24
    – Ian Turton
    Apr 17, 2020 at 14:02
  • Thanks again Ian. I have upgrade the WPS code and it now builds without errors. But the problem now is that the GeoServer generates a run time exception when starting up, Caused by: java.lang.ClassNotFoundException: org.locationtech.jts.geom.Geometry. I think this is because of I am still using the old GeoServer binaries. The point is I have modified the code of GeoTools, and moving my modifications to the new version will be very time consuming. Couldn't you please add the old versions to GeoServer and GeoTools to this new maven repository?
    – soso
    Apr 18, 2020 at 15:35
  • You need to look at the about geoserver page which will tell you which GeoTools build matches your GeoServer build - in general always work with the stable releases, currently 22.x and 1.16.x (until tomorrow or Monday when I finish releasing 23.0 and 1.17.0)
    – Ian Turton
    Apr 18, 2020 at 19:19
  • The point is that I was using old versions of GeoTools (v 19) and GeoServer (v 2.13.4). These two versions are not exist in the new repository. And I don't want to move my modifications of the GeoTools (v 19) to the new version, as it will be very time consuming. So my request was to put these old versions on the new repository.
    – soso
    Apr 18, 2020 at 20:04
0

I had the same problem and solve it with the following two step:

1- on pom.xml change the repository to

 <repositories>
  <repository>
    <id>osgeo</id>
    <name>OSGeo Release Repository</name>
    <url>https://repo.osgeo.org/repository/release/</url>
  </repository>
</repositories>

2- change the versoin of geotools and geoserver based on yours.

<properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <geotools.version>26.3</geotools.version>  <!-- change to GeoTools version -->
     <gs.version>2.20.3</gs.version>  <!-- change to GeoServer version -->
</properties>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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