Migrate from javax.annotation to jakarta.annotation namespace #4447
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jakarta EE 9.1 changed the package namespace from
javaxtojakarta. This migration enables compatibility with modern frameworks like Quarkus and Helidon that require the jakarta namespace.Changes
Source files
javax.annotation.*imports and fully-qualified annotations withjakarta.annotation.*across:utilmodule (@Nullable,@Nonnull)springmodule (@Resource)client-java-contrib/prometheus-operator(@Generated,@Nullable)client-java-contrib/admissionreview(@Nullable)Dependencies
javax.annotation-apifrom dependency management and all module pomsjakarta.annotation-apiwhere needed (util,prometheus-operator)kubernetes/pom.xmlnow serves as sole annotation sourcePre-merge validation
Added Spotless rule to prevent reintroduction of javax.annotation:
Builds will fail if any
javax.annotationimports are introduced.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
groovy.jfrog.io/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/work/java/java/.mvn/wrapper/maven-wrapper.jar -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/java/java org.apache.maven.wrapper.MavenWrapperMain spotless:check -pl util grep -l javax\.annotation erBehavior.java rceFieldRef.java -l dels/V1StorageClassListFluent.java rSpecSelfSigned.java grep /io/kubernetes/client/spring/extended/controller/KubernetesInformerCreatorTest.java dels/V1ResourceClaimTemplateListFluent.java /home/REDACTED/work/java/java/kubegrep(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/work/java/java/.mvn/wrapper/maven-wrapper.jar -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/java/java org.apache.maven.wrapper.MavenWrapperMain spotless:apply -pl util -Dgroovy.skip=true -q javax\.annotation va grep -l dels/V1ValidatingAdmissionPolicyListFluent.java /home/REDACTED/work/java/java/fluegrep grep /io/kubernetes/client/spring/extended/manifests/KubernetesManifestTest.java gnoredDuringExecutionInnerPodAffinityTermNamespaceSelector.java rReferenceBuilder.java(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.