Remove OSGi annotations from the API
See original GitHub issueThe OSGi annotations added in https://github.com/eclipse/microprofile-config/pull/381/, cause annoying compiler warnings.
The issue is that we mark the OSGi dependencies as provided and a reference to org.osgi.annotation.bundle.Requirement.Resolution#OPTIONAL
is missing from the dependencies when compiling a project that uses @ConfigProperty
.
Adding the OSGi dependency as compile does fix the issue, but I believe an MP API should not transitively push this kind of dependency to their consumers (especially if they are not using OSGi).
This can be reproduced just by using the MP Config API JAR, use the @ConfigProperty
annotation and compile code with warnings on: -Dmaven.compiler.showWarnings=true
. It generates the following warning:
[WARNING] unknown enum constant org.osgi.annotation.bundle.Requirement.Resolution.OPTIONAL
reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found
This causes confusion to users, and we should remove this warning.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:15 (9 by maintainers)
Top GitHub Comments
FYI, I am working a fix to the OSGi annotations to replace use of enum types with String along with a corresponding fix to Bnd to support this change.
FTR, I’m using following workaround in my Quarkus project (in root parent pom.xml):
This way it at least doesn’t end up in the production jar.