I have a Grade Multi-Project Build, that consist of following projects:
- fk_core
- fk_database
- fk_product
- fk_backend
In the project fk_product i have defined a QuarkusTest that starts up a Testcontainers-Database and tests a Rest-Endpoint in this project.
To make this possible i needed to define the quarkus-plugin within this project:
plugins {
...
id 'io.quarkus'
}
When i start the Gradle-Build via ./gradlew build a new error now occurs. My assumption is, that it is happening during the execution of the Tests during the Build, as the first line indicated that liquibase migrations are executing / have been executed and afterwards the error appears.
My Problem now is, that i need to define an almost empty src/main/resources/application.properties file in the fk_product project, that only contains the following line:
quarkus.datasource.db-kind=mariadb
then the error during the build goes away, and the tests also run correctly (btw: My Test uses a QuarkusTestProfile to override configurations to startup a Testcontainers Mariadb, which works fine.
Here is the problematic console-log of the build:
Error: 1146-42S02: Table testshop.DATABASECHANGELOGLOCK doesnt exist
The Agroal dependency is present but no JDBC datasources have been defined.
> Task :fk_product:quarkusAppPartsBuild FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':fk_product:quarkusAppPartsBuild'.
> There was a failure while executing work items
> A failure occurred while executing io.quarkus.gradle.tasks.worker.BuildWorker
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: jakarta.enterprise.inject.spi.DeploymentException: jakarta.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type io.agroal.api.AgroalDataSource and qualifiers [@Default]
- injection target: org.fk.core.jooq.ConfigurationFactory#dataSource
- declared on CLASS bean [types=[org.fk.core.jooq.ConfigurationFactory, java.lang.Object], qualifiers=[@Default, @Any], target=org.fk.core.jooq.ConfigurationFactory]
I'm using:
- plugin "io.quarkus" '3.8.2'
- quarkus: '3.8.2'
can someone give me a hint, what i can do to fix the build without the need of the additional application.properties file ? As i use a QuarkusTestProfile i expect this to be fully functional for the tests without any additional config-files.