quarkus: "[WARNING] unknown enum constant org.osgi.annotation.bundle.Requirement.Resolution.OPTIONAL" when compiler warnings are enabled
Describe the bug
maven-compiler-plugin
issues a warning when your app is using @ConfigProperty
and compiler warnings are enabled:
[INFO] Compiling 1 source file to /home/famod/proj/quarkus-quickstarts/config-quickstart/target/classes
[WARNING] unknown enum constant org.osgi.annotation.bundle.Requirement.Resolution.OPTIONAL
reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found
Expected behavior
No such warning.
Actual behavior
Warning w.r.t OSGI annotations. Also pollutes “real” compilation errors which can lead developers astray.
How to Reproduce?
./mvnw clean compile -f config-quickstart/ -Dmaven.compiler.showWarnings=true
in quarkus-quickstarts
.
Output of uname -a
or ver
Linux XXX 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.1.2.Final, probably since 2.0, up to current 999-SNAPSHOT
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.8.1
Additional information
https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/OSGI.20Warnings
https://mvnrepository.com/artifact/org.eclipse.microprofile.config/microprofile-config-api/2.0 defines provided OSGI annotations. Adding https://mvnrepository.com/artifact/org.osgi/osgi.annotation/7.0.0 works around the issue.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (10 by maintainers)
Commits related to this issue
- bundle annotations: Replace use of enum types Using enum types in the CLASS retention bundle annotations is causing issues for those using the annotations. Various tools, such as javadoc, attempt to ... — committed to bjhargrave/osgi by bjhargrave 2 years ago
- bundle annotations: Replace use of enum types Using enum types in the CLASS retention bundle annotations is causing issues for those using the annotations. Various tools, such as javadoc, attempt to ... — committed to bjhargrave/osgi by bjhargrave 2 years ago
- bundle annotations: Replace use of enum types Using enum types in the CLASS retention bundle annotations is causing issues for those using the annotations. Various tools, such as javadoc, attempt to ... — committed to bjhargrave/bnd by bjhargrave 2 years ago
- bundle annotations: Support replacement of enum types Using enum types in the CLASS retention bundle annotations is causing issues for those using the annotations. Various tools, such as javadoc, att... — committed to bjhargrave/bnd by bjhargrave 2 years ago
- bundle annotations: Replace use of enum types Using enum types in the CLASS retention bundle annotations is causing issues for those using the annotations. Various tools, such as javadoc, attempt to ... — committed to bjhargrave/osgi by bjhargrave 2 years ago
- bundle annotations: Support replacement of enum types Using enum types in the CLASS retention bundle annotations is causing issues for those using the annotations. Various tools, such as javadoc, att... — committed to bjhargrave/bnd by bjhargrave 2 years ago
FYI, https://github.com/eclipse/microprofile-config/pull/732 has been filed to update MicroProfile Config API to avoid the compiler warning issue.
Better open an issue in the respective quarkiverse extension with a small reproducer
I confirm the
upstream
label is added to mark issues that are waiting for an upstream fix. Ultimately, I’d like to remove them from our stats as there’s nothing we can do about them.