On Tuesday, 8 November 2022 10:12:57 PM AEDT paul.m...@lfv.se wrote:
> I've read info about 21.5 in
> https://docs.geotools.org/stable/userguide/welcome/upgrade.html , but I
> don't understand excactly what I have to do.

You need to understand what modules you were using, and update the 
dependencies to match.

> I changed the version in the pom-file:
> <properties>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>     <geotools.version>21.5</geotools.version>
>     <!--geotools.version>20.2</geotools.version-->
> </properties>
> ...
> ...
> <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>

The bit you have included looks fine, but the bit that is missing (the 
dependencies) is obviously crucial.

> 
> When the program is built I get the following errors:
> 1) GeoTools cannot be resolved ClassifiedStyleCreator.java
> /jdbcconnection5/src/main/java/org/geotools/jdbcconnection/mapview line 54
> Java Problem Line 54 in the java file:
> Set<Function> funcs =
> CommonFactoryFinder.getFunctions(GeoTools.getDefaultHints());

This is a symptom of the problem. I cannot fix all of your problems for you, 
but here is an example of it working standalone.

package net.frogmouth.demo.gtupdate;

import org.geotools.util.factory.GeoTools;

public class Main {

    public static void main(String[] args) {
        GeoTools.getDefaultHints();
    }
}

The corresponding maven pom.xml

<?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>net.frogmouth.demo</groupId>
    <artifactId>gtupdate</artifactId>
    <version>0.1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <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>
    <dependencies>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-metadata</artifactId>
            <version>21.5</version>
            <type>jar</type>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
</project>

HTH

Brad




_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to