maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MSHADE-303) Suppress module-info.class warning if the file if filtered
Date Wed, 31 Oct 2018 16:23:00 GMT

    [ https://issues.apache.org/jira/browse/MSHADE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670337#comment-16670337
] 

ASF GitHub Bot commented on MSHADE-303:
---------------------------------------

rfscholte closed pull request #8: [MSHADE-303] Suppress module-info.class warning if the file
if filtered
URL: https://github.com/apache/maven-shade-plugin/pull/8
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java b/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java
index ee633f8..825ed68 100644
--- a/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java
+++ b/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java
@@ -169,6 +169,12 @@ private void shadeJars( ShadeRequest shadeRequest, Set<String>
resources, List<R
                     JarEntry entry = j.nextElement();
 
                     String name = entry.getName();
+                    
+                    if ( entry.isDirectory() || isFiltered( jarFilters, name ) )
+                    {
+                        continue;
+                    }
+
 
                     if ( "META-INF/INDEX.LIST".equals( name ) )
                     {
@@ -185,18 +191,15 @@ private void shadeJars( ShadeRequest shadeRequest, Set<String>
resources, List<R
                         continue;
                     }
 
-                    if ( !entry.isDirectory() && !isFiltered( jarFilters, name )
)
+                    try
                     {
-                        try
-                        {
-                            shadeSingleJar( shadeRequest, resources, transformers, remapper,
jos, duplicates, jar,
-                                            jarFile, entry, name );
-                        }
-                        catch ( Exception e )
-                        {
-                            throw new IOException( String.format( "Problem shading JAR %s
entry %s: %s", jar, name, e ),
-                                                   e );
-                        }
+                        shadeSingleJar( shadeRequest, resources, transformers, remapper,
jos, duplicates, jar,
+                                        jarFile, entry, name );
+                    }
+                    catch ( Exception e )
+                    {
+                        throw new IOException( String.format( "Problem shading JAR %s entry
%s: %s", jar, name, e ),
+                                               e );
                     }
                 }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Suppress module-info.class warning if the file if filtered
> ----------------------------------------------------------
>
>                 Key: MSHADE-303
>                 URL: https://issues.apache.org/jira/browse/MSHADE-303
>             Project: Maven Shade Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.2.0
>            Reporter: Danila
>            Assignee: Robert Scholte
>            Priority: Major
>
> Maven always shows “Discovered module-info.class. Shading will break its strong encapsulation.”
warning, even then the user has explicitly filtered those files out. The same with “META-INF/INDEX.LIST”
file.
> I am going to issue a [pull request|https://github.com/apache/maven-shade-plugin/pull/8]
to fix this by applying file filters BEFORE these built-in warning checkers.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message