I have a Quarkus Multi-Module Project (with Gradle), with following projects:
- Core
- Module1
- Service1
Module1 contains an @ApplicationScope class that defines following Variable:
@Inject
@DataSource("database1")
AgroalDataSource dataSource;
When i now start the Gradle Build with following command (excluding tests)…
gradle clean build -x test
i get following error:
Unsatisfied dependency for type io.agroal.api.AgroalDataSource and qualifiers [@Default]
The reason for the Error is, that the Module1 does not contain an application.properties
file that defines the DataSource. But it also should not contain this, because the Service1 is the Quarkus Application where the application.properties
should define the “Runtime-Configuration” for itself and for all Modules (Core, Module1) that it uses.
Is there something i have missed in the Quarkus Arc documentation in regards to such a Multi-Module Setup?
Do i need to put an application.properties
file in my modules also, so i can build them with Quarkus Arc in mind? While this seems to work, it seems wrong, because then i need to provide wrong/placeholder properties just to satisfy the Arc Build.
It seems Quarkus Arc already needs to be able to resolve Configurations at Build-Time, and not at Runtime, to compile them directly into the Code, which contradicts the fact that Modules are often only “Liveable” together with the Services that they are run within.