configure Maven Shade minimizeJar to include class files

后端 未结 2 496
北恋
北恋 2020-12-05 06:08

I am trying to minimize the UberJar\'s size by using Maven Shade Plugin\'s minimizeJar. It looks like minimizeJar only includes class

2条回答
  •  天命终不由人
    2020-12-05 06:17

    This functionality has been added to version 1.6 of the maven-shade-plugin (just released). minimizeJar will now not remove classes that have been specifically included with filters. Note that including some of an artifact's classes in a filter will exclude non-specified classes for that artifact, so be sure to include all the classes that you need.

    Here's an example plugin config:

    
        org.apache.maven.plugins
        maven-shade-plugin
        1.6    
        
            
                package
                
                    shade
                                        
                
                    true    
                     
                        
                           log4j:log4j
                           
                               **
                           
                         
                        
                           commons-logging:commons-logging
                           
                               **
                           
                                              
                    
                
            
        
    
    

提交回复
热议问题