From a30bad3233df2a5bc91cb97e6f6fc10bff19d9c8 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sat, 6 Apr 2024 00:38:04 +0200 Subject: [PATCH 1/2] Add `defaultValue` for all boolean Mojo parameters Otherwise documentation will not mention the default, which will be confusing for the user. --- .../maven/plugins/shade/mojo/ShadeMojo.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java b/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java index 54aaebb5..843ba6ff 100644 --- a/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java +++ b/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java @@ -197,7 +197,7 @@ public class ShadeMojo extends AbstractMojo { *

* If you like to change the name of the native artifact, you may use the <build><finalName> setting. If this * is set to something different than <build><finalName>, no file replacement will be performed, even if - * shadedArtifactAttached is being used. + * {@link #shadedArtifactAttached} is false. */ @Parameter private String finalName; @@ -217,10 +217,10 @@ public class ShadeMojo extends AbstractMojo { private String shadedGroupFilter; /** - * Defines whether the shaded artifact should be attached as classifier to the original artifact. If false, the - * shaded jar will be the main artifact of the project + * Defines whether the shaded artifact should be attached as classifier to the original artifact. If false (the + * default), the shaded jar will be the main artifact of the project. */ - @Parameter + @Parameter(defaultValue = "false") private boolean shadedArtifactAttached; /** @@ -265,14 +265,14 @@ public class ShadeMojo extends AbstractMojo { /** * When true, dependencies are kept in the pom but with scope 'provided'; when false, the dependency is removed. */ - @Parameter + @Parameter(defaultValue = "false") private boolean keepDependenciesWithProvidedScope; /** * When true, transitive deps of removed dependencies are promoted to direct dependencies. This should allow the * drop in replacement of the removed deps with the new shaded jar and everything should still work. */ - @Parameter + @Parameter(defaultValue = "false") private boolean promoteTransitiveDependencies; /** @@ -284,13 +284,13 @@ public class ShadeMojo extends AbstractMojo { /** * When true, it will attempt to create a sources jar as well */ - @Parameter + @Parameter(defaultValue = "false") private boolean createSourcesJar; /** * When true, it will attempt to create a test sources jar. */ - @Parameter + @Parameter(defaultValue = "false") private boolean createTestSourcesJar; /** @@ -321,7 +321,7 @@ public class ShadeMojo extends AbstractMojo { * * @since 1.4 */ - @Parameter + @Parameter(defaultValue = "false") private boolean minimizeJar; /** From 08c4611abfc884526d70934628b061fa592c33cb Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sun, 14 Apr 2024 23:36:36 +0200 Subject: [PATCH 2/2] Revert change to `finalName` documentation. --- .../java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java b/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java index 843ba6ff..fcb41aab 100644 --- a/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java +++ b/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java @@ -197,7 +197,7 @@ public class ShadeMojo extends AbstractMojo { *

* If you like to change the name of the native artifact, you may use the <build><finalName> setting. If this * is set to something different than <build><finalName>, no file replacement will be performed, even if - * {@link #shadedArtifactAttached} is false. + * shadedArtifactAttached is being used. */ @Parameter private String finalName;