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

Migrate javax.inject and javax.annotations to Jakarta #1056

Closed
3 tasks done
HannesWell opened this issue Apr 29, 2023 · 10 comments
Closed
3 tasks done

Migrate javax.inject and javax.annotations to Jakarta #1056

HannesWell opened this issue Apr 29, 2023 · 10 comments

Comments

@HannesWell
Copy link
Member

HannesWell commented Apr 29, 2023

This is an umbrella issue to coordinate and collect the migration steps of the javax.inject and java.annotations bundles to Jakarta.

I'll start to work on the steps and update this initial comment with the created PRs.

HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Apr 29, 2023
- Only use Import-Package to for javax.annotation and javax.inject
- Always use closed version ranges [1.X,2) with a minor lower bound

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
HannesWell added a commit to HannesWell/eclipse.jdt.core that referenced this issue Apr 29, 2023
- Only use Import-Package to for javax.annotation
- Always use closed version ranges [1.X,2) with a minor lower bound
- Remove unused dependencies

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
iloveeclipse pushed a commit to eclipse-jdt/eclipse.jdt.core that referenced this issue Apr 29, 2023
- Only use Import-Package to for javax.annotation
- Always use closed version ranges [1.X,2) with a minor lower bound
- Remove unused dependencies

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
HannesWell added a commit to eclipse-pde/eclipse.pde that referenced this issue Apr 29, 2023
- Only use Import-Package to for javax.annotation and javax.inject
- Always use closed version ranges [1.X,2) with a minor lower bound

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
HannesWell added a commit to eclipse-platform/eclipse.platform.debug that referenced this issue Apr 29, 2023
- Always use closed version ranges [1.X,2) with a minor lower bound
- Mark package-import that is not optional as such

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
HannesWell added a commit to eclipse-platform/eclipse.platform.ua that referenced this issue Apr 29, 2023
HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Apr 29, 2023
- Only use Import-Package to for javax.annotation and javax.inject
- Always use closed version ranges [1.X,2) with a minor lower bound

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Apr 29, 2023
- Only use Import-Package to for javax.annotation and javax.inject
- Always use closed version ranges [1.X,2) with a minor lower bound

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
HannesWell added a commit to eclipse-platform/eclipse.platform that referenced this issue Apr 29, 2023
- Only use Import-Package to for javax.annotation and javax.inject
- Always use closed version ranges [1.X,2) with a minor lower bound

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
@HannesWell
Copy link
Member Author

The javax.inject/annotation bundles are also contained in some products and one feature. I think we can simply remove them there.
In the PDE the javax.inject/annotation bundle are also referenced as Packages and as Plugins in the E4 templates.
At least the parts where they are referenced as Plugins should be rewritten to use packages immediately.
And later, when the transition to the jakarta annotations is possible the package imports in the templates have to be adjusted too.

HannesWell added a commit to HannesWell/eclipse.platform.ui that referenced this issue May 1, 2023
HannesWell added a commit to eclipse-platform/eclipse.platform.ui that referenced this issue May 1, 2023
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue May 4, 2023
Use the javax namespace bundles provided by Jakarta.
Remove all corresponding bundles provided by Orbit.

Remove the unused javax.xml bundle, the modern JREs provide the
contained packages by default.

Part of eclipse-platform#1056
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue May 4, 2023
Use the javax namespace bundles provided by Jakarta.
Remove all javax bundles provided by Orbit.

Remove the unused javax.xml bundle, the modern JREs provide the
contained packages by default.

Part of eclipse-platform#1056
HannesWell added a commit to HannesWell/eclipse.platform.ui that referenced this issue May 4, 2023
During builds these annotation providing bundles are pulled in as
transitive dependencies any ways. Removing them from this features
simplifies the exchange of the atucally providing bundle and therefore
the migration to Jakarta.

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue May 4, 2023
Use Import-Package in all wizards/templates and tests instead of relying
on the name of the bundle that provides the javax.inject/annotation
packages.

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
akurtakov pushed a commit to eclipse-platform/eclipse.platform.swt that referenced this issue Nov 4, 2023
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Nov 4, 2023
to ensure it is provided and to maintain backwards compatibility until
support for javax annotations is finally removed.

Part of eclipse-platform#1056
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Nov 4, 2023
to ensure it is provided and to maintain backwards compatibility until
support for javax annotations is finally removed.

Part of eclipse-platform#1056
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Nov 4, 2023
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Nov 4, 2023
to ensure it is provided and to maintain backwards compatibility until
support for javax annotations is finally removed.

Part of eclipse-platform#1056
@HannesWell
Copy link
Member Author

Once the following PRs are submitted I consider the migration as completed:

Should we already open an issue in eclipse.platform about the eventual removal of support for javax-annotation in the injector?

HannesWell added a commit that referenced this issue Nov 4, 2023
to ensure it is provided and to maintain backwards compatibility until
support for javax annotations is finally removed.

Part of #1056
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Nov 5, 2023
iloveeclipse added a commit to iloveeclipse/spotbugs that referenced this issue Nov 14, 2023
This prevents spotbugs provided "javax.annotation" packages to be
consumed by bundles that expect default (not spotbugs)
"javax.annotation" packages that were previously shipped with
"javax.annotation" bundle with SDK.

The problem appears since 4.30 SDK doesn't ship "javax.annotation"
bundle anymore, so spotbugs exported packages are taken as alternative
if the application doesn't have other providers and in worst case they
are not what applications actually expected to receive or cause
dependency cycles (spotbugs requires some bundle that requires some
other that imports "javax.annotation" package that is coming from
spotbugs).

The packages originally were needed by detectors shipped as bundles for
IDE, but this is a very seldom case and in that case
spotbugs-annotations is the better alternative. We should not export
"wrong" javax packages anymore, it wasn't nice and it can cause only
trouble now.

See eclipse-platform/eclipse.platform.releng.aggregator#1056
iloveeclipse added a commit to spotbugs/spotbugs that referenced this issue Nov 15, 2023
This prevents spotbugs provided "javax.annotation" packages to be
consumed by bundles that expect default (not spotbugs)
"javax.annotation" packages that were previously shipped with
"javax.annotation" bundle with SDK.

The problem appears since 4.30 SDK doesn't ship "javax.annotation"
bundle anymore, so spotbugs exported packages are taken as alternative
if the application doesn't have other providers and in worst case they
are not what applications actually expected to receive or cause
dependency cycles (spotbugs requires some bundle that requires some
other that imports "javax.annotation" package that is coming from
spotbugs).

The packages originally were needed by detectors shipped as bundles for
IDE, but this is a very seldom case and in that case
spotbugs-annotations is the better alternative. We should not export
"wrong" javax packages anymore, it wasn't nice and it can cause only
trouble now.

See eclipse-platform/eclipse.platform.releng.aggregator#1056
@akurtakov
Copy link
Member

Is there anything still to be done here?

HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Nov 18, 2023
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Nov 18, 2023
@HannesWell
Copy link
Member Author

Is there anything still to be done here?

With #1510 being merged, I now consider this as resolved.

laeubi pushed a commit to laeubi/eclipse.pde that referenced this issue Jan 28, 2024
Michael5601 pushed a commit to CodeLtDave/eclipse.platform that referenced this issue Feb 12, 2024
Michael5601 pushed a commit to CodeLtDave/eclipse.platform that referenced this issue Feb 12, 2024
Rework the E4 InjectorImpl and introduce the AnnotationLookup class to
handle a potential absence of javax-annotations at runtime.

Print a warning if the 'old' javax-annotations are available at runtime
to encourage users to migrate.
The warning can be suppressed with the VM-property
-Declipse.e4.inject.javax.warning=false

Make the remaining imports of javax.inject/annotation packages optional.

Annotations who's classes cannot be loaded at runtime are silently
ignored by the JVM, as if they where not declared.

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
robstryker pushed a commit to robstryker/eclipse.jdt.core that referenced this issue Jul 18, 2024
- Only use Import-Package to for javax.annotation
- Always use closed version ranges [1.X,2) with a minor lower bound
- Remove unused dependencies

Part of eclipse-platform/eclipse.platform.releng.aggregator#1056
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants