Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin migration to Jakarta Annotations #320

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

basil
Copy link
Member

@basil basil commented Jan 4, 2022

Problem

Core ships the Java EE annotation API, which is consumed both in core itself and in Stapler (a core dependency). Specifically, we consume javax.annotation.PostConstruct. configuration-as-code, coverity, datetime-constraint, opentelemetry, and strict-crumb-issuer consume javax.annotation.PostConstruct from core. coverity, jira, and opentelemetry consume javax.annotation.PreDestroy from core. gitlab-plugin consumes javax.annotation.Priority from core. All of these are subject to Jakarta package renames. This means we need to come up with a migration plan.

Solution

This PR begins a migration by shipping both the old javax.annotation classes and the new jakarta.annotation classes, adjusting Stapler to check both jakarta.annotation.PostConstruct and javax.annotation.PostConstruct for backward compatibility. Stapler itself is migrated to jakarta.annotation, and when this PR is merged and released and core upgrades to it, then core can also switch to jakarta.annotation. This just leaves the plugins mentioned above. As each plugin upgrades its core baseline to one that includes a Stapler release with this PR, the plugin can migrate from javax.annotation to jakarta.annotation. Once each of the above plugins has done so and the PRs have been merged and released, usage-in-plugins should show no usages for javax.annotation in the ecosystem. At that point, the javax.annotation:javax.annotation-api dependency can be removed and the migration will be considered complete.

@basil basil merged commit 229a24f into jenkinsci:master Jan 5, 2022
@basil basil deleted the jakarta-annotation branch January 5, 2022 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants