Files
spring-cloud-contract/samples/standalone/webclient/http-client/build.gradle
2023-12-14 11:15:16 +01:00

65 lines
1.7 KiB
Groovy

plugins {
id "groovy"
id "org.springframework.boot"
id "io.spring.dependency-management"
id "maven-publish"
}
group = 'com.example'
version = '0.0.1'
repositories {
mavenCentral()
mavenLocal()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-contract-dependencies:${verifierVersion}"
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
testImplementation 'org.springframework.cloud:spring-cloud-starter-contract-stub-runner'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation "com.example:http-server-webclient:0.0.1:stubs"
}
test {
useJUnitPlatform()
include '**/*GradleTests*'
systemProperty 'spring.profiles.active', 'gradle'
testLogging {
exceptionFormat = 'full'
}
afterSuite { desc, result ->
if (!desc.parent) {
println "Results: (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
if (result.testCount == 0) {
throw new IllegalStateException("No tests were found. Failing the build")
}
}
}
}
task resolveDependencies {
doLast {
project.rootProject.allprojects.each { subProject ->
subProject.buildscript.configurations.each { configuration ->
configuration.resolve()
}
subProject.configurations.each { configuration ->
configuration.resolve()
}
}
}
}