我正在尝试使用 spring boot poject 配置 gradle id 'jvm-test-suite' 插件
plugins {
id 'java'
id 'jvm-test-suite'
id 'org.springframework.boot' version '3.0.0'
id 'io.spring.dependency-management' version '1.1.0'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
ext {
set('testcontainersVersion', "1.17.6")
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-web'
}
dependencyManagement {
imports {
mavenBom "org.testcontainers:testcontainers-bom:${testcontainersVersion}"
}
}
testing {
suites {
configureEach {
useJUnitJupiter()
dependencies {
implementation project()
implementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.testcontainers:junit-jupiter'
implementation 'org.testcontainers:mongodb'
}
}
test {
}
integrationTest(JvmTestSuite) …Run Code Online (Sandbox Code Playgroud)