You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Simon Cooper <si...@featurespace.co.uk> on 2014/09/05 12:02:37 UTC

Rename a reference WITHOUT including it in the shaded uberjar

Hi,

Is it possible to use shade to rename all references to a provided package without including that package in the uberjar?

The scenario is that my code depends on a provided project that shades some of its dependencies, but I explicitly want to call a public method in that project that returns an instance of a shaded type. So, in my project, I want to rename all references to that type in my code to the new shaded type so that the code works in my IDE (referencing the non-shaded maven dependency) and in the resulting built package (referencing the new shaded package), without including that package in my jar. Can shade do this?

And, yes, I know I shouldn't really be doing this, as it's shaded for a reason, but not being able to use that public method would require re-implementing a LOT of code myself, and I want to avoid that.

Thanks,
SimonC