How to resolve a library conflict (apache commons-codec)

前端 未结 5 1495
盖世英雄少女心
盖世英雄少女心 2020-12-11 03:49

I have a problem with Android libraries.

I would like use the method Hex.encodeHexString(Byte Array) from the library org.apache.commons.codec.binary.Hex (version 1

5条回答
  •  爱一瞬间的悲伤
    2020-12-11 04:32

    Late reply but maybe usefull for someone.

    Problem solved by using Maven Shade Plugin

    This plugin allows to rename package names of conflicted library at compilation.

    Usage :

       
            org.apache.maven.plugins
            maven-shade-plugin
            
                
                package
                
                    shade
                    
                
                        
                            
                                    org.apache.commons
                                        com.example.shaded.org.apache.commons
                            
                        
                            true
                
                
            
        
    

提交回复
热议问题