Tricky dependencies in multi module projects

2022-07-08 Thread Niels Basjes
Hi, I have a library project that uses dependencies that are prone to cause conflicts when another project wants to use my software. Antlr4 is a common example because it enforces the versions of the generated code and the runtime to be an exact match. In my maven project I have a main library an

Re: Tricky dependencies in multi module projects

2022-07-08 Thread Francois Marot
Hello Niels, I believe you used the shade maven plugin or equivalent. I faced this problem multiple times and to my knowledge, there is no "good" solution. The problem is that Maven computes the dependency graph for all modules of the reactor right at the start. But when the shade plugin integrate

Re: Tricky dependencies in multi module projects

2022-07-08 Thread Jörg Schaible
Hi, simply declare the dependency with scope "provided" in the project that shades it. Regards, Jörg On Fritday, 8. July 2022, 17:43:16 CEST Francois Marot wote: > Hello Niels, > > I believe you used the shade maven plugin or equivalent. I faced this > problem multiple times and to my knowledg

Re: Tricky dependencies in multi module projects

2022-07-09 Thread Niels Basjes
Hi, If I set these dependencies to 'provided' I have not been able to ensure they are actually inserted (and relocated) into the final shaded jar file. Niels On Fri, Jul 8, 2022 at 6:36 PM Jörg Schaible wrote: > Hi, > > simply declare the dependency with scope "provided" in the project that >

Re: Tricky dependencies in multi module projects

2022-07-10 Thread Niels Basjes
Hi, On Fri, Jul 8, 2022 at 5:43 PM Francois Marot wrote: > I believe you used the shade maven plugin or equivalent. Yes > I faced this > problem multiple times and to my knowledge, there is no "good" solution. > I was afraid of that. > The problem is that Maven computes the dependency gra

Re: Tricky dependencies in multi module projects

2022-07-11 Thread Francois Marot
> I do not understand what you are trying to explain here. Sorry I was not clear at all ! I was trying to say that in a multimodule build, if you have a module shaded with the shade plugin, my rule of thumb is to NEVER have another module listing this shaded module in its dependencies. Said otherw