Open shelajev opened 1 year ago
Hey, sorry for the late reply, I missed your ticket.
Your issue seems to be related with the Spring Dependency Plugin, see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/319, and https://github.com/r2dbc/r2dbc-bom/issues/44
Unfortunately I couldn't fix it using this plugin, but I found a probable even better approach without the plugin at all. If you change your build.gradle
to the following:
plugins {
id 'org.springframework.boot' version '3.0.1'
id 'java'
id("io.micronaut.test-resources") version "3.6.7"
}
apply plugin: 'java'
group = 'org.springframework.samples'
version = '3.0.0'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
ext.webjarsFontawesomeVersion = "4.7.0"
ext.webjarsBootstrapVersion = "5.1.3"
ext.springBootVersion = "3.0.1"
dependencies {
implementation platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
developmentOnly platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'javax.cache:cache-api'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api'
runtimeOnly 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly "org.webjars.npm:bootstrap:${webjarsBootstrapVersion}"
runtimeOnly "org.webjars.npm:font-awesome:${webjarsFontawesomeVersion}"
runtimeOnly 'com.github.ben-manes.caffeine:caffeine'
runtimeOnly 'com.mysql:mysql-connector-j'
runtimeOnly 'org.postgresql:postgresql'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly("io.cloudflight.testresources.springboot:springboot-testresources-client:0.2.0")
testResourcesImplementation ("io.cloudflight.testresources.springboot:springboot-testresources-jdbc-postgres:0.2.0")
testImplementation "org.testcontainers:postgresql"
}
tasks.named('test') {
useJUnitPlatform()
}
Then you're participating in Gradle's native platform functionality and dependency resolution works fine.
I'm trying springboot-testresources on a Spring Boot Petclinic app, and I think I followed the instructions properly, but when i try to build it, or run the individual test from my IDE (PetClinicIntegrationTests), then it fails with the following error:
Do you know what can I try to resolve? I added Testcontainers BOM to explicitly provide the versions, but it doesn't seem to help.
The project if you want to try it is here: Github repo