idea 打包package 的时候警告:Discovered module-info.class. Shading will break its strong encapsulation.

idea 打包package 的时候警告:Discovered module-info.class. Shading will break its strong encapsulation.

文章目录

    • idea 打包package 的时候警告:Discovered module-info.class. Shading will break its strong encapsulation.
    • 问题背景:版本
    • 问题原因:maven-shade-plugin缺少配置
    • 解决办法:加上一些配置

问题背景:版本

idea版本:ideaIU-2020.1.2
JDK:1.8.0_141
maven版本:3.6.3
maven-shade-plugin:3.2.1

问题原因:maven-shade-plugin缺少配置



    4.0.0


    cn.itcast.mapreduce
    day03_mapreduce_workcount
    1.0-SNAPSHOT
    jar

    
        
            UTF-8
        
    

    
    
        
            cloudera
            https://repository.cloudera.com/artifactory/cloudera-repos/
        
    

    
        
            org.apache.hadoop
            hadoop-common
            3.1.1
            provided
        
        
            org.apache.hadoop
            hadoop-hdfs
            3.1.1
        
        
            org.apache.hadoop
            hadoop-hdfs-client
            3.1.1
            provided
        
        
            org.apache.hadoop
            hadoop-client
            3.1.1
        
        
            org.junit.jupiter
            junit-jupiter-api
            5.7.0-M1
        
    

    
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                3.1
                
                    1.8
                    1.8
                    UTF-8
                
            
            
                org.apache.maven.plugins
                maven-shade-plugin
                3.2.1













                
                    
                        package
                        
                            shade
                        
                        
                            true
                        
                    
                
            
        
    

package的时候报错
idea 打包package 的时候警告:Discovered module-info.class. Shading will break its strong encapsulation._第1张图片

解决办法:加上一些配置

                
                    
                        
                            *:*
                            
                                module-info.class
                                META-INF/*.SF
                                META-INF/*.DSA
                                META-INF/*.RSA
                            
                        
                    
                

加上就能打包成功:
idea 打包package 的时候警告:Discovered module-info.class. Shading will break its strong encapsulation._第2张图片

你可能感兴趣的:(问题记录,maven,apache,hadoop)