You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Quiyan H <qu...@gmail.com> on 2020/07/02 21:18:25 UTC

Help with shading jar

Hi All
I am stuck with one shading stuff, Need help if there is known way out.
I have a project module which has bunch of dependencies and I want to shade
and relocate one of the dependency. I did that, but the problem is the
other dependency also uses the dependency that I shaded, but that doesn’t
use the relocated class, is there any way to make the other dependency use
the relocated shaded class instead of the original.
The catch is I can’t shade this other dependency due to other conflicts.

Module
DependencyA (uses dependency B as well)
DependencyB (shaded and relocated)

Want to make dependency A use relocated classes in the Module rather than
direct dependency B

Any help, even if it is something which can not be done, Please let me
know!!!

Waiting for a response!!!

Re: Help with shading jar

Posted by Alexander Kriegisch <al...@kriegisch.name>.
I think some more detail and an actual sample project [1] would be more helpful than just prose. I am by no means an expert in the subject matter, but just last week I struggled with shading and package relocation too, so from what I still remember I might be able to help if I could reproduce your problem.

[1] [MCVE](https://stackoverflow.com/help/mcve)
-- 
Alexander Kriegisch
https://scrum-master.de


Quiyan H schrieb am 03.07.2020 04:18 (GMT +07:00):

> Hi All
> I am stuck with one shading stuff, Need help if there is known way out.
> I have a project module which has bunch of dependencies and I want to shade
> and relocate one of the dependency. I did that, but the problem is the
> other dependency also uses the dependency that I shaded, but that doesn’t
> use the relocated class, is there any way to make the other dependency use
> the relocated shaded class instead of the original.
> The catch is I can’t shade this other dependency due to other conflicts.
> 
> Module
> DependencyA (uses dependency B as well)
> DependencyB (shaded and relocated)
> 
> Want to make dependency A use relocated classes in the Module rather than
> direct dependency B
> 
> Any help, even if it is something which can not be done, Please let me
> know!!!
> 
> Waiting for a response!!!
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help with shading jar

Posted by Russell Gold <ru...@oracle.com>.
Are they part of the same build?

Can you create a minimal example and post it to GitHub? There’s really not enough detail to understand what you are trying to do.

> On Jul 2, 2020, at 5:18 PM, Quiyan H <qu...@gmail.com> wrote:
> 
> Hi All
> I am stuck with one shading stuff, Need help if there is known way out.
> I have a project module which has bunch of dependencies and I want to shade
> and relocate one of the dependency. I did that, but the problem is the
> other dependency also uses the dependency that I shaded, but that doesn’t
> use the relocated class, is there any way to make the other dependency use
> the relocated shaded class instead of the original.
> The catch is I can’t shade this other dependency due to other conflicts.
> 
> Module
> DependencyA (uses dependency B as well)
> DependencyB (shaded and relocated)
> 
> Want to make dependency A use relocated classes in the Module rather than
> direct dependency B
> 
> Any help, even if it is something which can not be done, Please let me
> know!!!
> 
> Waiting for a response!!!


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Help with shading jar

Posted by Russell Gold <ru...@oracle.com>.
Are they part of the same build?

Can you create a minimal example and post it to GitHub? There’s really not enough detail to understand what you are trying to do.

> On Jul 2, 2020, at 5:18 PM, Quiyan H <qu...@gmail.com> wrote:
> 
> Hi All
> I am stuck with one shading stuff, Need help if there is known way out.
> I have a project module which has bunch of dependencies and I want to shade
> and relocate one of the dependency. I did that, but the problem is the
> other dependency also uses the dependency that I shaded, but that doesn’t
> use the relocated class, is there any way to make the other dependency use
> the relocated shaded class instead of the original.
> The catch is I can’t shade this other dependency due to other conflicts.
> 
> Module
> DependencyA (uses dependency B as well)
> DependencyB (shaded and relocated)
> 
> Want to make dependency A use relocated classes in the Module rather than
> direct dependency B
> 
> Any help, even if it is something which can not be done, Please let me
> know!!!
> 
> Waiting for a response!!!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Help with shading jar

Posted by Quiyan H <qu...@gmail.com>.
Any idea or solutions??

On Friday, July 3, 2020, Quiyan H <qu...@gmail.com> wrote:

> Hi All
> I am stuck with one shading stuff, Need help if there is known way out.
> I have a project module which has bunch of dependencies and I want to
> shade and relocate one of the dependency. I did that, but the problem is
> the other dependency also uses the dependency that I shaded, but that
> doesn’t use the relocated class, is there any way to make the other
> dependency use the relocated shaded class instead of the original.
> The catch is I can’t shade this other dependency due to other conflicts.
>
> Module
> DependencyA (uses dependency B as well)
> DependencyB (shaded and relocated)
>
> Want to make dependency A use relocated classes in the Module rather than
> direct dependency B
>
> Any help, even if it is something which can not be done, Please let me
> know!!!
>
> Waiting for a response!!!
>