From 35fec09b65ccdb5d3b6020b97d634c33d23270bf Mon Sep 17 00:00:00 2001 From: Bert Scholten Date: Wed, 5 Feb 2025 10:44:52 +0100 Subject: [PATCH 1/3] Updated dependencies Using aerius root pom to avoid declaring the same stuff over and over again. For those dependencies not defined there, put the version in properties. --- pom.xml | 136 ++++++++------------------------------------------------ 1 file changed, 19 insertions(+), 117 deletions(-) diff --git a/pom.xml b/pom.xml index 55927de..d6ab876 100644 --- a/pom.xml +++ b/pom.xml @@ -18,11 +18,18 @@ --> 4.0.0 - nl.aerius + + + nl.aerius + aerius-root-pom + 1.1.0-SNAPSHOT + + + sld-generator-maven-plugin SLD Generator Maven Plugin AERIUS SLD Generator Maven Plugin generates SLD style files from JSON. - 1.1.0 + 1.2.0-SNAPSHOT maven-plugin @@ -44,34 +51,13 @@ HEAD - - - aerius-nexus - https://nexus.aerius.nl/repository/maven-releases/ - - - aerius-nexus - https://nexus.aerius.nl/repository/maven-snapshots/ - - - - 17 - 17 - UTF-8 - UTF-8 - - 3.8.2 - 5.7.2 - 2.12.3 - - 1.1.0 - 2.5.0 - 0.8.12 + 3.9.9 + 1.13.0 + 3.15.1 + aerius_sld-generator-maven-plugin ${project.artifactId} - aerius - https://sonarcloud.io @@ -86,38 +72,34 @@ org.apache.maven maven-plugin-api - ${maven-plugin.version} + ${maven-plugin-api.version} provided org.apache.maven.plugin-tools maven-plugin-annotations - ${maven-plugin.version} provided org.apache.commons commons-text - 1.9 + ${apache-commons-text.version} com.fasterxml.jackson.core jackson-databind - ${jackson.version} org.junit.jupiter - junit-jupiter-engine - ${junit.version} + junit-jupiter test - org.junit.jupiter - junit-jupiter-params - ${junit.version} + org.mockito + mockito-core test @@ -127,91 +109,11 @@ org.apache.maven.plugins maven-plugin-plugin - ${maven-plugin.version} + ${maven-plugin-plugin.version} org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 - - - - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - - pom.xml - - - pom-xml-header.txt - <project - - - - - XML - - pom-xml.prefs - - - - - - - src/*/java/nl/aerius/**/*.java - - - checkstyle-header.txt - - - eclipse_code_formatter_profile.xml - - - eclipse.importorder - - - - - - - nl.aerius - tools - ${aerius-tools.version} - - - - - - com.mycila - license-maven-plugin - 3.0 - -
license-header.txt
- - - SLASHSTAR_STYLE - - - - **/*.java - **/pom.xml - - - - - **/src/main/java/com/**/*.java - -
- - - nl.aerius - tools - ${aerius-tools.version} - -
From 166a5ea33cec28bfc1d27b74dcbd03bb646a1884 Mon Sep 17 00:00:00 2001 From: Bert Scholten Date: Wed, 5 Feb 2025 10:45:58 +0100 Subject: [PATCH 2/3] Formatting files Appeasing spotless --- .../nl/aerius/sldgenerator/input/ZoomLevel.java | 11 +++++------ .../sldgenerator/input/ZoomLevelsJsonFile.java | 3 +++ .../aerius/sldgenerator/plugin/SldPluginMojo.java | 14 ++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/nl/aerius/sldgenerator/input/ZoomLevel.java b/src/main/java/nl/aerius/sldgenerator/input/ZoomLevel.java index 6fbb4ee..eb917b9 100644 --- a/src/main/java/nl/aerius/sldgenerator/input/ZoomLevel.java +++ b/src/main/java/nl/aerius/sldgenerator/input/ZoomLevel.java @@ -26,10 +26,9 @@ public class ZoomLevel { private int maxScale; // Object must be constructable from Jackson - public ZoomLevel() { - } + public ZoomLevel() {} - public ZoomLevel(int zoomLevel, int minScale, int maxScale) { + public ZoomLevel(final int zoomLevel, final int minScale, final int maxScale) { this.zoomLevel = zoomLevel; this.minScale = minScale; this.maxScale = maxScale; @@ -42,7 +41,7 @@ public int getZoomLevel() { return zoomLevel; } - public void setZoomLevel(int zoomLevel) { + public void setZoomLevel(final int zoomLevel) { this.zoomLevel = zoomLevel; } @@ -53,7 +52,7 @@ public int getMinScale() { return minScale; } - public void setMinScale(int minScale) { + public void setMinScale(final int minScale) { this.minScale = minScale; } @@ -64,7 +63,7 @@ public int getMaxScale() { return maxScale; } - public void setMaxScale(int maxScale) { + public void setMaxScale(final int maxScale) { this.maxScale = maxScale; } } diff --git a/src/main/java/nl/aerius/sldgenerator/input/ZoomLevelsJsonFile.java b/src/main/java/nl/aerius/sldgenerator/input/ZoomLevelsJsonFile.java index 5066fbd..561ab2a 100644 --- a/src/main/java/nl/aerius/sldgenerator/input/ZoomLevelsJsonFile.java +++ b/src/main/java/nl/aerius/sldgenerator/input/ZoomLevelsJsonFile.java @@ -19,4 +19,7 @@ import java.util.ArrayList; public class ZoomLevelsJsonFile extends ArrayList { + + private static final long serialVersionUID = 1L; + } diff --git a/src/main/java/nl/aerius/sldgenerator/plugin/SldPluginMojo.java b/src/main/java/nl/aerius/sldgenerator/plugin/SldPluginMojo.java index 03a5adb..5737cd2 100644 --- a/src/main/java/nl/aerius/sldgenerator/plugin/SldPluginMojo.java +++ b/src/main/java/nl/aerius/sldgenerator/plugin/SldPluginMojo.java @@ -36,15 +36,13 @@ @Mojo(name = "generate-sld", defaultPhase = LifecyclePhase.PROCESS_RESOURCES) public class SldPluginMojo extends AbstractMojo { - @Parameter - private File sourcePath; + @Parameter private File sourcePath; - @Parameter - private File targetPath; + @Parameter private File targetPath; - @Parameter - private String targetPostfix = ""; + @Parameter private final String targetPostfix = ""; + @Override public void execute() throws MojoExecutionException { try { @@ -66,12 +64,12 @@ public void execute() throws MojoExecutionException { SldPlugin.generateSld(getLog(), sourceFilePath, outputStream); outputStream.close(); - } catch (JacksonException e) { + } catch (final JacksonException e) { throw new MojoExecutionException("JSON Parse Error at (" + sourceFilePath + ") while generating SLDs", e); } } - } catch (IOException e) { + } catch (final IOException e) { throw new MojoExecutionException("IO Error while generating SLDs", e); } } From 2f6ccf5f2d80515d7360d5ce6e00180de1404ea0 Mon Sep 17 00:00:00 2001 From: Bert Scholten Date: Wed, 5 Feb 2025 10:46:58 +0100 Subject: [PATCH 3/3] Adding toString method This inner class is used in a sysout statement, with this method that becomes a bit more readable. --- .../java/nl/aerius/sldgenerator/generator/SldUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/nl/aerius/sldgenerator/generator/SldUtils.java b/src/main/java/nl/aerius/sldgenerator/generator/SldUtils.java index 3147dae..f981292 100644 --- a/src/main/java/nl/aerius/sldgenerator/generator/SldUtils.java +++ b/src/main/java/nl/aerius/sldgenerator/generator/SldUtils.java @@ -359,6 +359,12 @@ public ConditionOperatorEnum getConditionOperator() { public String getValue() { return value; } + + @Override + public String toString() { + return "ParsedCondition [key=" + key + ", conditionOperator=" + conditionOperator + ", value=" + value + "]"; + } + } private enum SymbolizerType {