Change root package of Java JAR
I am writing a Java Agent which makes use of the Java ASM library for handling byte code. This is a common library and I want to be sure about the version of ASM which my code is using at runtime.
What is the easiest and most automated way to take the ASM classes and process them into a private copy where all the classes hav开发者_运维知识库e been relocated into a new root package.
To be specific, I want to take the ASM jars and turn org.objectweb.asm.*
into org.myproject.internal.org.objectweb.asm.*
Please remember that I am mostly interested in an automated solution. I know that I could get the sources for ASM and do this manually or with a script and then recompile the jars but this feels like a lot of overhead.
jarjar
is a tool that does exactly what you want.
精彩评论