Maven WEB项目使用ProGuard进行混淆,最佳解决方案

最新版com.github.wvengen代替了老的com.pyx4me
在pom.xml文件中添加

         
           
                com.github.wvengen
                proguard-maven-plugin
                
                 2.0.11
             
               
                   
                       
                        package
                       
                           
                            proguard
                       

                   

               

               
                   
                    true
                   
                    true
                   
                    pg
                   
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       



                       
                       
               
                        
                        
                       
                       
                       
                     
                       
                       
                       
                      
                        
                   

                    ${project.build.finalName}-pg.jar
                   
                   
                        ${java.home}/lib/rt.jar
                   

                   
                    classes
                   
                    ${project.build.directory}
               

           



使用Maven运行以上代码,执行完成后在target目录中会生成三个文件

    classes-pg.jar 混淆后的classes文件,里面包含完整的项目结构
    proguard_map.txt 混淆内容的映射
    proguard_seed.txt 参与混淆的类


混淆完成后,将classes-pg.jar解压覆盖应用下WEB-INF\classes目录下所有文件

你可能感兴趣的:(Maven WEB项目使用ProGuard进行混淆,最佳解决方案)