Index: applications/editors/josm/plugins/cadastre-fr/build.xml
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 36118)
+++ applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 36122)
@@ -4,5 +4,5 @@
     <property name="commit.message" value="recompile for compatibility with JOSM r17896"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="17896"/>
+    <property name="plugin.main.version" value="18723"/>
     
     <!-- Configure these properties (replace "..." accordingly).
Index: applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/api/CadastreAPI.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/api/CadastreAPI.java	(revision 36118)
+++ applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/api/CadastreAPI.java	(revision 36122)
@@ -5,14 +5,15 @@
 
 import java.io.IOException;
-import java.io.StringReader;
 import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URL;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonObject;
-import javax.json.JsonStructure;
+import jakarta.json.Json;
+import jakarta.json.JsonArray;
+import jakarta.json.JsonObject;
+import jakarta.json.JsonReader;
+import jakarta.json.JsonStructure;
 
 import org.openstreetmap.josm.data.Bounds;
@@ -55,6 +56,7 @@
      */
     public static Set<String> getSheets(double minlon, double minlat, double maxlon, double maxlat) throws IOException {
-        URL url = new URL(API_ENDPOINT.get() + "/feuilles?bbox=" + String.join(",",
-                Double.toString(minlon), Double.toString(minlat), Double.toString(maxlon), Double.toString(maxlat)));
+        URL url = URI.create(API_ENDPOINT.get() + "/feuilles?bbox=" + String.join(",",
+                Double.toString(minlon), Double.toString(minlat), Double.toString(maxlon), Double.toString(maxlat)))
+                .toURL();
         try {
             Response response = HttpClient.create(url).connect();
@@ -65,10 +67,12 @@
                         "geo@data.gouv.fr"));
             }
-            JsonStructure json = Json.createReader(new StringReader(response.fetchContent())).read();
-            if (json instanceof JsonArray) {
-                return json.asJsonArray().stream().map(x -> x.asJsonObject().getString("id")).collect(Collectors.toSet());
-            } else {
-                JsonObject obj = json.asJsonObject();
-                throw new IOException(new OsmApiException(obj.getInt("code"), null, obj.getString("message"), url.toExternalForm()));
+            try (JsonReader reader = Json.createReader(response.getContentReader())) {
+                JsonStructure json = reader.read();
+                if (json instanceof JsonArray) {
+                    return json.asJsonArray().stream().map(x -> x.asJsonObject().getString("id")).collect(Collectors.toSet());
+                } else {
+                    JsonObject obj = json.asJsonObject();
+                    throw new IOException(new OsmApiException(obj.getInt("code"), null, obj.getString("message"), url.toExternalForm()));
+                }
             }
         } catch (MalformedURLException e) {
