Skip to content

Commit 85437c9

Browse files
andreaTPmanusa
authored andcommitted
[java-generator] Deprecate configuration options identified for removal
1 parent fa3d6ea commit 85437c9

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
- JSON patch methods using an item for the diff generation such as edit or patch will no longer omit the resourceVersion in the patch. If you want the patch to be unlocked, then set the resourceVersion to null on the item to be patched.
6464
- internal logic to mimic an apply that modify an item prior to a JSON patch is deprecated - you should instead build the item to be patched off of base version, such as with the edit method.
6565

66+
#### _**Note**_: Deprecations
67+
* Fix #4875: Deprecated all the java-generator options identified for deletion in a following release
68+
6669
### 6.4.1 (2023-01-31)
6770

6871
#### Bugs

java-generator/cli/src/main/java/io/fabric8/java/generator/cli/GenerateJavaSources.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,17 @@ public class GenerateJavaSources implements Runnable {
5555
@Option(names = { "-enum-uppercase", "--enum-uppercase" }, description = "Uppercase the enum values", required = false)
5656
Boolean uppercaseEnum = null;
5757

58+
@Deprecated
5859
@Option(names = { "-prefix-strategy",
5960
"--prefix-strategy" }, description = "The prefix strategy to be used", required = false, hidden = true)
6061
String prefixStrategy = null;
6162

62-
@Option(names = { "-suffix-strategy", "--suffix-strategy" }, description = "The suffix strategy to be used", required = false)
63+
@Deprecated
64+
@Option(names = { "-suffix-strategy",
65+
"--suffix-strategy" }, description = "The suffix strategy to be used", required = false, hidden = true)
6366
String suffixStrategy = null;
6467

68+
@Deprecated
6569
@Option(names = { "-always-preserve-unknown",
6670
"--always-preserve-unknown" }, description = "Always preserve unknown fields in the generated classes", required = false, hidden = true)
6771
Boolean alwaysPreserveUnkownFields = null;
@@ -70,6 +74,7 @@ public class GenerateJavaSources implements Runnable {
7074
"--add-extra-annotations" }, description = "Add extra lombok and sundrio annotation to the generated classes", required = false)
7175
Boolean addExtraAnnotations = null;
7276

77+
@Deprecated
7378
@Option(names = { "-code-structure",
7479
"--code-structure" }, description = "Generate classes using a specific layout", required = false, hidden = true)
7580
String codeStructure = null;

java-generator/core/src/main/java/io/fabric8/java/generator/Config.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ public enum Suffix {
5151
private static final Map<String, String> DEFAULT_PACKAGE_OVERRIDES = new HashMap<>();
5252

5353
private Boolean uppercaseEnums = DEFAULT_UPPERCASE_ENUM;
54+
@Deprecated
5455
private Prefix prefixStrategy = DEFAULT_PREFIX_STRATEGY;
56+
@Deprecated
5557
private Suffix suffixStrategy = DEFAULT_SUFFIX_STRATEGY;
58+
@Deprecated
5659
private Boolean alwaysPreserveUnknownFields = DEFAULT_ALWAYS_PRESERVE_FIELDS;
5760
private Boolean objectExtraAnnotations = DEFAULT_ADD_EXTRA_ANNOTATIONS;
61+
@Deprecated
5862
private CodeStructure structure = DEFAULT_CODE_STRUCTURE;
5963
private Boolean generatedAnnotations = DEFAULT_ADD_GENERATED_ANNOTATIONS;
6064
private Map<String, String> packageOverrides = DEFAULT_PACKAGE_OVERRIDES;

java-generator/maven-plugin/src/main/java/io/fabric8/java/generator/maven/plugin/JavaGeneratorMojo.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,26 @@ public class JavaGeneratorMojo extends AbstractMojo {
7474
Boolean enumUppercase = null;
7575

7676
/**
77-
* *advanced* The prefix strategy for name mangling
77+
* *DEPRECATED* The prefix strategy for name mangling
7878
*
7979
*/
80+
@Deprecated
8081
@Parameter(property = "fabric8.java-generator.prefix-strategy", required = false)
8182
Config.Prefix prefixStrategy = null;
8283

8384
/**
84-
* *advanced* The suffix strategy for name mangling
85+
* *DEPRECATED* The suffix strategy for name mangling
8586
*
8687
*/
88+
@Deprecated
8789
@Parameter(property = "fabric8.java-generator.suffix-strategy", required = false)
8890
Config.Suffix suffixStrategy = null;
8991

9092
/**
91-
* *advanced* Always inject additional properties in the generated classes
93+
* *DEPRECATED* Always inject additional properties in the generated classes
9294
*
9395
*/
96+
@Deprecated
9497
@Parameter(property = "fabric8.java-generator.always-preserve-unknown", required = false)
9598
Boolean alwaysPreserveUnknown = null;
9699

@@ -102,9 +105,10 @@ public class JavaGeneratorMojo extends AbstractMojo {
102105
Boolean extraAnnotations = null;
103106

104107
/**
105-
* *advanced* The code structure to be used when generating java sources
108+
* *DEPRECATED* The code structure to be used when generating java sources
106109
*
107110
*/
111+
@Deprecated
108112
@Parameter(property = "fabric8.java-generator.code-structure", required = false)
109113
protected Config.CodeStructure codeStructure = null;
110114

0 commit comments

Comments
 (0)