I am building a project that makes use of ASM and I am therefore using the Shadow plugin for repackaging the dependency into my name space. This works fine. In the end, I need two builds, one with the original dependencies and one with the imported dependencies.
However, I am running into a problem:
The Shadow plugin is apparently not capable of building source code and javadoc artifacts that respect the namespace change. I wonder if there exists an alternative.
I saw that other projects like Mockito “solved” this problem by manually repackaging the dependency: https://github.com/mockito/mockito/tree/master/cglib-and-asm - I hope that I can avoid this.
Is there a plugin that actually rearranges the source code before compiling? This would allow for the creation of any artifact that derives from the latter and it would allow for some sort of validation on compilation.
I looked at the Shadow plugin’s source code which is actually a one to one copy of the Maven Shade plugin and it rearranges the imports by replacing the corresponding values in the constant pool. This would actually lead to Strings being renamed as well since they are shared in the constant pool so this is a rather hacky aproach.
Thanks for any hints!