This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git

commit c648ccfade767acd5a59893a1719b58ed02fad99
Author: Alexander Kriegisch <alexan...@kriegisch.name>
AuthorDate: Mon Jul 12 16:01:33 2021 +0700

    [MSHADE-396] Add explanation to shadeSourcesContent documentation
    
    Explain purpose and limitations of heuristic source code shading
    approach.
---
 .../org/apache/maven/plugins/shade/mojo/ShadeMojo.java   | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 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 6cc019c..d717253 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
@@ -327,9 +327,19 @@ public class ShadeMojo
     private boolean createTestSourcesJar;
 
     /**
-     * When true, it will attempt to shade the contents of the java source 
files when creating the sources jar. When
-     * false, it will just relocate the java source files to the shaded paths, 
but will not modify the actual contents
-     * of the java source files.
+     * When true, it will attempt to shade the contents of Java source files 
when creating the sources JAR. When false,
+     * it will just relocate the Java source files to the shaded paths, but 
will not modify the actual source file
+     * contents.
+     * <p>
+     * <b>Please note:</b> This feature uses a heuristic search & replace 
approach which covers many, but definitely not
+     * all possible cases of source code shading and its excludes. There is no 
full Java parser behind this
+     * functionality, which would be the only way to get this right for Java 
language elements. As for matching within
+     * Java string constants, this is next to impossible to get 100% right, 
trying to guess if they are used in
+     * reflection or not.
+     * <p>
+     * Please understand that the source shading feature is not meant as a 
source code generator anyway, merely as a
+     * tool creating reasonably plausible source code when navigating to a 
relocated library class from an IDE,
+     * hopefully displaying source code which makes 95% sense - no more, no 
less.
      */
     @Parameter( property = "shadeSourcesContent", defaultValue = "false" )
     private boolean shadeSourcesContent;

Reply via email to