From b92c39aab85d856f66f4d2c133fa93394597b0fc Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Mon, 11 May 2026 11:20:04 -0300 Subject: [PATCH] Resolve Jackson 2.21.0 builder deprecation warning Replace deprecated serializationInclusion() with defaultPropertyInclusion() to satisfy -Werror. This aligns with the new Jackson 2.21+ requirement for unified property inclusion configuration. --- .../java/org/geowebcache/service/wmts/WMTSTileJSON.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/geowebcache/wmts/src/main/java/org/geowebcache/service/wmts/WMTSTileJSON.java b/geowebcache/wmts/src/main/java/org/geowebcache/service/wmts/WMTSTileJSON.java index 8fe8353fb..c8f5bb89f 100644 --- a/geowebcache/wmts/src/main/java/org/geowebcache/service/wmts/WMTSTileJSON.java +++ b/geowebcache/wmts/src/main/java/org/geowebcache/service/wmts/WMTSTileJSON.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.json.JsonMapper; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; @@ -76,8 +77,11 @@ public void writeResponse(TileLayer layer) { @SuppressWarnings("PMD.CloseResource") // managed by servlet container OutputStream os = convTile.servletResp.getOutputStream(); - ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + ObjectMapper mapper = JsonMapper.builder() + .defaultPropertyInclusion( + JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.USE_DEFAULTS)) + .build(); + mapper.writeValue(os, json); os.flush(); } catch (IOException ioe) {