views:

47

answers:

1

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 have 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.

A: 

jarjar is a tool that does exactly what you want.

Joachim Sauer
Perfect thank you!
mchr