Q:

Geotools CQL to OGC filter

I'm trying to convert a CQL filter to OCG. I followed this example: https://blog.ianturton.com/geotools/code/ogc/2015/03/18/Generating-OGC-Filters.html
In line with org.geotools.xml.Configuration configuration = 
               new org.geotools.filter.v1_0.OGCConfiguration(); I get 

"Incompatible types error: Required: org.geotools.xml.Configuration
  Found: org.geotools.filter.v1_0.OGCConfiguration"

What could be the problem, since I'd say that the example provided in the link is working.
My dependency for that part is:

<dependency>
  <groupId>org.geotools.xsd</groupId>
  <artifactId>gt-xsd-filter</artifactId>
  <version>21.0</version>
</dependency>

A:

As a fuller answer if you want to use this code in GeoTools v21+ you need to change the imports to be:
import org.geotools.xsd.Configuration;
import org.geotools.xsd.Encoder;

and the dependancies to:
<dependencies>
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-main</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <dependency>
        <groupId>org.geotools.xsd</groupId>
        <artifactId>gt-xsd-filter</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <dependency> <!--for fes (filter 2.0)-->
        <groupId>org.geotools.xsd</groupId>
        <artifactId>gt-xsd-fes</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-cql</artifactId>
        <version>${geotools.version}</version>
    </dependency>
</dependencies>

