graphql-java-codegen icon indicating copy to clipboard operation
graphql-java-codegen copied to clipboard

javax is not maintaned replace with jakarta

Open xenoterracide opened this issue 11 months ago • 3 comments

Is your feature request related to a problem? Please describe.

javax anything is no longer maintained it causes problem with using JPMS. If you are using jpms with a module-info this code would not compile.

Describe the solution you'd like

Generated

Generated should be replaced jakarta annotations Generated https://jakarta.ee/specifications/annotations/2.0/apidocs/jakarta.annotation/jakarta/annotation/generated

do not set the date as that will cause the build to not be reproducible.

javax.validation

replace this with the jakarta.validation api. I know there's another ticket about replacing anotations but the other non null annotations are replacements for jsr305 and not related to the validation spec which is for runtime

At a glance the quality compile time non null don't exist... but if those are desired both of those should be replaced with jspecify as that's what spring stack and gradle are going with. I suspect it's not limited to those, but they're the elephants I'm aware of.

xenoterracide avatar Feb 20 '25 21:02 xenoterracide

We also need this, all validators are now broken if you use a new framework cause us a lot of time.

Harriebo avatar Mar 11 '25 13:03 Harriebo

My workaround, meanwhile, is using the config

<generatedAnnotation>jakarta.annotation.Generated</generatedAnnotation>
<modelValidationAnnotation>@jakarta.validation.constraints.NotNull</modelValidationAnnotation>

But yea, a general fix could be nice. Maybe GeneratedLanguage option could have another option like JAVA_JAKARTA and this code could have a switch based on it.

Feel free to contribute!

rwo-trackunit avatar Mar 17 '25 15:03 rwo-trackunit

I mean, we need 2 things, although there are 2 tickets, one is the validation spec, but we also need static analysis annotations (replacing jsr305) which is in another ticket. Community (spring/gradle) are moving forward with jspecify.

xenoterracide avatar Mar 18 '25 12:03 xenoterracide