Smallrye ConfigSourceFactory not loading class
See original GitHub issueDescribe the bug
When using a ConfigSourceFactory
the class is not loaded and the build (both maven and gradle) fails with:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.737 s
[INFO] Finished at: 2021-11-25T11:24:15-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.5.0.Final:generate-code (default) on project bidder: Quarkus code generation phase has failed: InvocationTargetException: io.smallrye.config.ConfigSourceFactory: Provider com.adquick.service.athena.ConsumerConfig not found -> [Help 1]
Goals tested: quarkus:dev
, compile
, package
.
The class referenced in the src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceFactory
file is being loaded before its compilation.
Works when using Quarkus 1.13.4.
Expected behavior
The config factory should be loaded and executed.
Actual behavior
Buidl failes with:
Caused by: java.util.ServiceConfigurationError: io.smallrye.config.ConfigSourceFactory: Provider com.adquick.service.athena.ConsumerConfig not found
at java.util.ServiceLoader.fail (ServiceLoader.java:593)
at java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass (ServiceLoader.java:1219)
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService (ServiceLoader.java:1228)
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext (ServiceLoader.java:1273)
at java.util.ServiceLoader$2.hasNext (ServiceLoader.java:1309)
at java.util.ServiceLoader$3.hasNext (ServiceLoader.java:1393)
How to Reproduce?
Run quarkus:dev to reproduce:
./mvnw clean compile quarkus:dev
A “workaround”:
- Comment the class in:
src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceFactory
-
Run
./mvnw compile
-
Uncomment the class
-
Run:
./mvnw quarkus:dev
Output of uname -a
or ver
Darwin Andre-MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64
Output of java -version
openjdk version “17.0.1” 2021-10-19 OpenJDK Runtime Environment GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05) OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.5.0.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Yes, but then the code doesn’t compile - we use quarkus-avro.
@radcortez if I understand the quesiton correctly, then the answer is yes. Having properties from application.properties/yaml should be enough for code gen IMO