From 0b3b19a1dbc8fea2e9c7abf4937fe4ec9dabd4ca Mon Sep 17 00:00:00 2001 From: Andrea Peruffo Date: Tue, 12 Sep 2023 11:04:32 +0100 Subject: [PATCH] review --- doc/java-generation-from-CRD.md | 3 ++- .../io/fabric8/java/generator/cli/GenerateJavaSources.java | 2 +- .../generator/gradle/plugin/JavaGeneratorPluginExtension.java | 2 +- java-generator/it/src/it/crd-names/pom.xml | 2 +- java-generator/it/src/it/datetime-fmt/pom.xml | 2 +- java-generator/it/src/it/default-values-instantiation/pom.xml | 2 +- java-generator/it/src/it/escape-characters/pom.xml | 2 +- .../it/src/it/preserve-unknown-objects-through-config/pom.xml | 2 +- java-generator/it/src/it/preserve-unknown-objects/pom.xml | 2 +- java-generator/it/src/it/preserve-unknown-serdeser/pom.xml | 2 +- java-generator/it/src/it/ser-deser/pom.xml | 2 +- .../fabric8/java/generator/maven/plugin/JavaGeneratorMojo.java | 2 +- 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/doc/java-generation-from-CRD.md b/doc/java-generation-from-CRD.md index ec98f90f6a4..57eac379632 100644 --- a/doc/java-generation-from-CRD.md +++ b/doc/java-generation-from-CRD.md @@ -122,7 +122,8 @@ And the corresponding configurations of the Maven plugin are (output of `mvn hel ``` alwaysPreserveUnknown User property: fabric8.java-generator.always-preserve-unknown - Always inject additional properties in the generated classes + Always preserve unknown fields in the generated classes by emitting an + additionalProperties field datetimeDeserializationFormat User property: fabric8.java-generator.datetime-deserialization-format diff --git a/java-generator/cli/src/main/java/io/fabric8/java/generator/cli/GenerateJavaSources.java b/java-generator/cli/src/main/java/io/fabric8/java/generator/cli/GenerateJavaSources.java index 2f8b2743bfa..2019c0a9176 100644 --- a/java-generator/cli/src/main/java/io/fabric8/java/generator/cli/GenerateJavaSources.java +++ b/java-generator/cli/src/main/java/io/fabric8/java/generator/cli/GenerateJavaSources.java @@ -64,7 +64,7 @@ public class GenerateJavaSources implements Runnable { Boolean skipGeneratedAnnotations = null; @Option(names = { "-always-preserve-unknown", - "--always-preserve-unknown" }, description = "Always preserve unknown fields in the generated classes", required = false, hidden = false) + "--always-preserve-unknown" }, description = "Always preserve unknown fields in the generated classes by emitting an additionalProperties field", required = false, hidden = false) Boolean alwaysPreserveUnkown = null; @Option(names = { "-package-overrides", diff --git a/java-generator/gradle-plugin/src/main/java/io/fabric8/java/generator/gradle/plugin/JavaGeneratorPluginExtension.java b/java-generator/gradle-plugin/src/main/java/io/fabric8/java/generator/gradle/plugin/JavaGeneratorPluginExtension.java index af7208532c7..209ccbcee6a 100644 --- a/java-generator/gradle-plugin/src/main/java/io/fabric8/java/generator/gradle/plugin/JavaGeneratorPluginExtension.java +++ b/java-generator/gradle-plugin/src/main/java/io/fabric8/java/generator/gradle/plugin/JavaGeneratorPluginExtension.java @@ -146,7 +146,7 @@ public void setGeneratedAnnotations(final Boolean isGeneratedAnnotations) { } /** - * Emit the @javax.annotation.processing.Generated annotation on the generated sources + * Always preserve unknown fields in the generated classes by emitting an additionalProperties field * */ public Boolean getAlwaysPreserveUnknown() { diff --git a/java-generator/it/src/it/crd-names/pom.xml b/java-generator/it/src/it/crd-names/pom.xml index ff46105d779..bc1e8afe87a 100644 --- a/java-generator/it/src/it/crd-names/pom.xml +++ b/java-generator/it/src/it/crd-names/pom.xml @@ -79,7 +79,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + @maven.surefire.plugin.version@ false false diff --git a/java-generator/it/src/it/datetime-fmt/pom.xml b/java-generator/it/src/it/datetime-fmt/pom.xml index 9dd16dd9b3e..5f039235706 100644 --- a/java-generator/it/src/it/datetime-fmt/pom.xml +++ b/java-generator/it/src/it/datetime-fmt/pom.xml @@ -96,7 +96,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + @maven.surefire.plugin.version@ false false diff --git a/java-generator/it/src/it/default-values-instantiation/pom.xml b/java-generator/it/src/it/default-values-instantiation/pom.xml index 674f921e816..2a532839f62 100644 --- a/java-generator/it/src/it/default-values-instantiation/pom.xml +++ b/java-generator/it/src/it/default-values-instantiation/pom.xml @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + @maven.surefire.plugin.version@ false false diff --git a/java-generator/it/src/it/escape-characters/pom.xml b/java-generator/it/src/it/escape-characters/pom.xml index f91a245971f..343f577d6a5 100644 --- a/java-generator/it/src/it/escape-characters/pom.xml +++ b/java-generator/it/src/it/escape-characters/pom.xml @@ -76,7 +76,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + @maven.surefire.plugin.version@ false false diff --git a/java-generator/it/src/it/preserve-unknown-objects-through-config/pom.xml b/java-generator/it/src/it/preserve-unknown-objects-through-config/pom.xml index f1faaa891f6..1cc8dddbf10 100644 --- a/java-generator/it/src/it/preserve-unknown-objects-through-config/pom.xml +++ b/java-generator/it/src/it/preserve-unknown-objects-through-config/pom.xml @@ -77,7 +77,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + @maven.surefire.plugin.version@ false false diff --git a/java-generator/it/src/it/preserve-unknown-objects/pom.xml b/java-generator/it/src/it/preserve-unknown-objects/pom.xml index 3f5a6413e41..c7969121c9c 100644 --- a/java-generator/it/src/it/preserve-unknown-objects/pom.xml +++ b/java-generator/it/src/it/preserve-unknown-objects/pom.xml @@ -76,7 +76,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + @maven.surefire.plugin.version@ false false diff --git a/java-generator/it/src/it/preserve-unknown-serdeser/pom.xml b/java-generator/it/src/it/preserve-unknown-serdeser/pom.xml index dc5108c0a80..be495e69c6b 100644 --- a/java-generator/it/src/it/preserve-unknown-serdeser/pom.xml +++ b/java-generator/it/src/it/preserve-unknown-serdeser/pom.xml @@ -76,7 +76,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + @maven.surefire.plugin.version@ false false diff --git a/java-generator/it/src/it/ser-deser/pom.xml b/java-generator/it/src/it/ser-deser/pom.xml index bb6ca1b12e2..da1d7cc9c78 100644 --- a/java-generator/it/src/it/ser-deser/pom.xml +++ b/java-generator/it/src/it/ser-deser/pom.xml @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + @maven.surefire.plugin.version@ false false diff --git a/java-generator/maven-plugin/src/main/java/io/fabric8/java/generator/maven/plugin/JavaGeneratorMojo.java b/java-generator/maven-plugin/src/main/java/io/fabric8/java/generator/maven/plugin/JavaGeneratorMojo.java index 4cdbe078f54..c2c62003de6 100644 --- a/java-generator/maven-plugin/src/main/java/io/fabric8/java/generator/maven/plugin/JavaGeneratorMojo.java +++ b/java-generator/maven-plugin/src/main/java/io/fabric8/java/generator/maven/plugin/JavaGeneratorMojo.java @@ -88,7 +88,7 @@ public class JavaGeneratorMojo extends AbstractMojo { Boolean generatedAnnotations = null; /** - * Always inject additional properties in the generated classes + * Always preserve unknown fields in the generated classes by emitting an additionalProperties field * */ @Parameter(property = "fabric8.java-generator.always-preserve-unknown", required = false)