gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS buildscript { ext { springBootVersion = '3.4.3' springCloudVersion = '2024.0.0' gatewayStarterVersion = '4.2.0' logbackVersion = '1.2.9' logstashLogbackVersion = '7.3' lombokVersion = '1.18.36' } repositories { mavenCentral() } dependencies { classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" } } subprojects { apply plugin: 'java' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' group = 'me.bvn13.jateway' sourceCompatibility = 17 targetCompatibility = 17 tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } //------------------- Настройка интеграционных тестов (start) --------------------- sourceSets { integrationTest { java { compileClasspath += sourceSets.main.output runtimeClasspath += sourceSets.main.output compileClasspath += sourceSets.test.output runtimeClasspath += sourceSets.test.output srcDir file('src/integration-test/java') } resources.srcDir file('src/integration-test/resources') } } configurations { integrationTestImplementation.extendsFrom testImplementation integrationTestRuntimeOnly.extendsFrom testRuntimeOnly } task integrationTest(type: Test) { testClassesDirs = sourceSets.integrationTest.output.classesDirs classpath = sourceSets.integrationTest.runtimeClasspath outputs.upToDateWhen { false } } check.dependsOn integrationTest integrationTest.mustRunAfter test //------------------- Настройка интеграционных тестов (end) --------------------- dependencies { implementation "org.springframework.boot:spring-boot-starter:${springBootVersion}" testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootVersion}") { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } compileOnly "org.projectlombok:lombok:${lombokVersion}" annotationProcessor "org.projectlombok:lombok:${lombokVersion}" testCompileOnly "org.projectlombok:lombok:${lombokVersion}" testAnnotationProcessor("org.projectlombok:lombok:${lombokVersion}") // testImplementation 'org.assertj:assertj-core' // testImplementation 'org.mockito:mockito-core' } test { useJUnitPlatform() systemProperties System.properties // Нужно, иначе Jacoco не работает systemProperties['user.dir'] = workingDir } integrationTest { useJUnitPlatform() systemProperties System.properties } } // Task to download all dependencies for all targets task downloadDependencies { doLast { rootProject.allprojects { project -> Set configurations = project.buildscript.configurations + project.configurations configurations.findAll { c -> c.canBeResolved } .forEach { c -> c.resolve() } } } }