As it can be read in this answer, SBT (sbt-assembly) allows package renaming in the project that is importing the renamed library. e.g:
I want to use the package org.pfcoperez.algorithms
in my project but I want to "see" it, that is: be able to import it, as com.algorithms
.
I know that Maven Shade Plugin can relocate dependencies as described here:
<relocations>
<relocation>
<pattern>org.codehaus.plexus.util</pattern>
<shadedPattern>org.shaded.plexus.util</shadedPattern>
<excludes>
<exclude>org.codehaus.plexus.util.xml.Xpp3Dom</exclude>
<exclude>org.codehaus.plexus.util.xml.pull.*</exclude>
</excludes>
</relocation>
</relocations>
I could use that to generate an intermediate jar having the new package structure. However, I'd like to avoid using that intermediate artifact.
Is it possible to do this in a Maven project as it is in SBT? If the answer is yes, how could it be done?