[maven-shade-plugin] branch master updated (bba67c3 -> 22b230d)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven-shade-plugin] branch master updated (bba67c3 -> 22b230d)

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

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


    from bba67c3  Bump asmVersion from 8.0 to 8.0.1
     new ba0cc3c  [MSHADE-371] add .md support to the Apache License and Notice transformers
     new 22b230d  [MSHADE-371] Added test cases

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../plugins/shade/resource/ApacheLicenseResourceTransformer.java    | 5 ++++-
 .../plugins/shade/resource/ApacheNoticeResourceTransformer.java     | 6 +++++-
 src/site/apt/examples/resource-transformers.apt.vm                  | 6 +++---
 .../shade/resource/ApacheLicenseResourceTransformerTest.java        | 1 +
 .../plugins/shade/resource/ApacheNoticeResourceTransformerTest.java | 1 +
 5 files changed, 14 insertions(+), 5 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[maven-shade-plugin] 01/02: [MSHADE-371] add .md support to the Apache License and Notice transformers

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

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

commit ba0cc3c317cd3545a5634339c6cd1bfc2491dd52
Author: John Millner <[hidden email]>
AuthorDate: Sun Jun 7 16:52:00 2020 -0400

    [MSHADE-371] add .md support to the Apache License and Notice transformers
   
    Closes #51
---
 .../plugins/shade/resource/ApacheLicenseResourceTransformer.java    | 5 ++++-
 .../plugins/shade/resource/ApacheNoticeResourceTransformer.java     | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformer.java b/src/main/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformer.java
index 524ffdd..85a1652 100644
--- a/src/main/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformer.java
+++ b/src/main/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformer.java
@@ -35,11 +35,14 @@ public class ApacheLicenseResourceTransformer
     private static final String LICENSE_PATH = "META-INF/LICENSE";
 
     private static final String LICENSE_TXT_PATH = "META-INF/LICENSE.txt";
+    
+    private static final String LICENSE_MD_PATH = "META-INF/LICENSE.md";
 
     public boolean canTransformResource( String resource )
     {
         return LICENSE_PATH.equalsIgnoreCase( resource )
-            || LICENSE_TXT_PATH.regionMatches( true, 0, resource, 0, LICENSE_TXT_PATH.length() );
+            || LICENSE_TXT_PATH.regionMatches( true, 0, resource, 0, LICENSE_TXT_PATH.length()
+            || LICENSE_MD_PATH.regionMatches( true, 0, resource, 0, LICENSE_MD_PATH.length());
     }
 
     public void processResource( String resource, InputStream is, List<Relocator> relocators, long time )
diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java b/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java
index e75062b..b7bdc4c 100644
--- a/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java
+++ b/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java
@@ -80,10 +80,14 @@ public class ApacheNoticeResourceTransformer
     private static final String NOTICE_PATH = "META-INF/NOTICE";
 
     private static final String NOTICE_TXT_PATH = "META-INF/NOTICE.txt";
+    
+    private static final String NOTICE_MD_PATH = "META-INF/NOTICE.md";
 
     public boolean canTransformResource( String resource )
     {
-        return NOTICE_PATH.equalsIgnoreCase( resource ) || NOTICE_TXT_PATH.equalsIgnoreCase( resource );
+        return NOTICE_PATH.equalsIgnoreCase( resource )
+            || NOTICE_TXT_PATH.equalsIgnoreCase( resource )
+            || NOTICE_MD_PATH.equalsIgnoreCase( resource );
 
     }
 

Reply | Threaded
Open this post in threaded view
|

[maven-shade-plugin] 02/02: [MSHADE-371] Added test cases

slachiewicz
In reply to this post by slachiewicz
This is an automated email from the ASF dual-hosted git repository.

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

commit 22b230ddfb1bed8e5ba3379d1581358ac720a948
Author: Sylwester Lachiewicz <[hidden email]>
AuthorDate: Sat Jun 27 14:07:20 2020 +0200

    [MSHADE-371] Added test cases
---
 .../plugins/shade/resource/ApacheLicenseResourceTransformer.java    | 4 ++--
 src/site/apt/examples/resource-transformers.apt.vm                  | 6 +++---
 .../shade/resource/ApacheLicenseResourceTransformerTest.java        | 1 +
 .../plugins/shade/resource/ApacheNoticeResourceTransformerTest.java | 1 +
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformer.java b/src/main/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformer.java
index 85a1652..9ae341a 100644
--- a/src/main/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformer.java
+++ b/src/main/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformer.java
@@ -41,8 +41,8 @@ public class ApacheLicenseResourceTransformer
     public boolean canTransformResource( String resource )
     {
         return LICENSE_PATH.equalsIgnoreCase( resource )
-            || LICENSE_TXT_PATH.regionMatches( true, 0, resource, 0, LICENSE_TXT_PATH.length()
-            || LICENSE_MD_PATH.regionMatches( true, 0, resource, 0, LICENSE_MD_PATH.length());
+            || LICENSE_TXT_PATH.regionMatches( true, 0, resource, 0, LICENSE_TXT_PATH.length() )
+            || LICENSE_MD_PATH.regionMatches( true, 0, resource, 0, LICENSE_MD_PATH.length() );
     }
 
     public void processResource( String resource, InputStream is, List<Relocator> relocators, long time )
diff --git a/src/site/apt/examples/resource-transformers.apt.vm b/src/site/apt/examples/resource-transformers.apt.vm
index 536adcc..4af315a 100644
--- a/src/site/apt/examples/resource-transformers.apt.vm
+++ b/src/site/apt/examples/resource-transformers.apt.vm
@@ -443,9 +443,9 @@ Transformers in <<<org.apache.maven.plugins.shade.resource.properties>>> (availa
 ** Preventing License Duplication with the {ApacheLicenseResourceTransformer}
 
   Some open source producers
-  (including the {{{http://www.apache.org} Apache Software Foundation}})
+  (including the {{{https://www.apache.org} Apache Software Foundation}})
   include a copy of their license in the META-INF directory. These are conventionally named
-  either <<<LICENSE>>> or <<<LICENSE.txt>>>. When merging these dependencies, adding these
+  either <<<LICENSE>>>,<<<LICENSE.txt>>> or <<<LICENSE.md>>>. When merging these dependencies, adding these
   resources may cause confusion.
   The <<<ApacheLicenseResourceTransformer>>> ensures that duplicate licenses (named according
   to this convention) are not merged.
@@ -485,7 +485,7 @@ Transformers in <<<org.apache.maven.plugins.shade.resource.properties>>> (availa
 ** Aggregating Notices with the {ApacheNoticeResourceTransformer}
 
   Some licenses
-  (including the {{{http://www.apache.org/licenses/LICENSE-2.0.html} Apache License, Version 2}})
+  (including the {{{https://www.apache.org/licenses/LICENSE-2.0.html} Apache License, Version 2}})
   require that notices are preserved by downstream distributors. <<<ApacheNoticeResourceTransformer>>>
   automates the assembly of an appropriate <<<NOTICE>>>.
 
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformerTest.java b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformerTest.java
index 2c214c0..35666eb 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformerTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformerTest.java
@@ -52,6 +52,7 @@ public class ApacheLicenseResourceTransformerTest
     {
         assertTrue( this.transformer.canTransformResource( "META-INF/LICENSE" ) );
         assertTrue( this.transformer.canTransformResource( "META-INF/LICENSE.TXT" ) );
+        assertTrue( this.transformer.canTransformResource( "META-INF/LICENSE.md" ) );
         assertTrue( this.transformer.canTransformResource( "META-INF/License.txt" ) );
         assertFalse( this.transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
     }
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerTest.java b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerTest.java
index 80dc8b3..89029e1 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerTest.java
@@ -52,6 +52,7 @@ public class ApacheNoticeResourceTransformerTest
     {
         assertTrue( this.transformer.canTransformResource( "META-INF/NOTICE" ) );
         assertTrue( this.transformer.canTransformResource( "META-INF/NOTICE.TXT" ) );
+        assertTrue( this.transformer.canTransformResource( "META-INF/NOTICE.md" ) );
         assertTrue( this.transformer.canTransformResource( "META-INF/Notice.txt" ) );
         assertFalse( this.transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
     }