Nice suggestion Rémi!

I added a "javax" classifier for "groovy-servlet" and updated my jetty
hello-world example repo accordingly:

https://github.com/paulk-asert/groovy-servlet-hello

On Mon, Dec 23, 2024 at 11:06 PM Remi Forax <fo...@univ-mlv.fr> wrote:
>
> ----- Original Message -----
> > From: "Jochen Theodorou" <blackd...@gmx.org>
> > To: "MG" <mg...@arscreat.com>, "dev" <dev@groovy.apache.org>
> > Sent: Monday, December 23, 2024 10:39:55 AM
> > Subject: Re: Replacing javax.* with jakarta.*
>
> > On 21.12.24 16:43, MG wrote:
> >> Hi Jochen,
> >>
> >>  1. that sounds like a good idea, but I am just wondering if ppl who are
> >>     in this situation might not potentially have other (Java) libraries
> >>     in use, for which they would need to do the renaming of the class
> >>     references also.
> >
> > In my last project I was using Spring with jakarta namespace, and
> > several and yes, that impacted several other choices I made in
> > libraries. But usually there jakarta was either the only choice or they
> > offered both.
> >
> >>  2. So maybe having a chapter in the Groovy documentation which explains
> >>     how to do this so it plays well with Groovy might be the more
> >>     generally applicable & easier to do option ?
> >>      1. (Note: "plays well with Groovy" might not be an issue here, but
> >>         I am just thinking back to the pains of Minecraft obfuscation
> >>         not working with Groovy generated bytecode)
> >
> > The problem with obfuscation is actually the obfuscation of the MOP
> > relevant methods and the obfuscation of extension methods, that are part
> > of the Groovy runtime.
> >
> > But a chapter about how to change the class names is not going to be
> > easy to understand. Imagine a gradle dependency groovy-servlet:javax and
> > you need it as jakarta. Then you would have to transform the dependency
> > after gradle added it. Possible, but painful. And with maven I do not
> > know how you would do that.
>
> I think it's easier to have the dependency to use "jakarta.*" by default and 
> use "javax" as classifier if you want the "javax.*" dependencies.
> For me, i think it's easier to add a post step after creating the jar to 
> rewrite it to use "javax" with the shade plugin and add the classfier "javax" 
> and publish both artefacts.
>
> >
> > bye Jochen
>
> Rémi

Reply via email to