78 lines
2.3 KiB
Groovy
78 lines
2.3 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
maven { url "https://repo.spring.io/snapshot" }
|
|
maven { url "https://repo.spring.io/milestone" }
|
|
maven { url "https://repo.spring.io/release" }
|
|
}
|
|
dependencies {
|
|
classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}"
|
|
}
|
|
}
|
|
|
|
group = 'com.example'
|
|
version = '0.0.1'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
maven { url "https://repo.spring.io/snapshot" }
|
|
maven { url "https://repo.spring.io/milestone" }
|
|
maven { url "https://repo.spring.io/release" }
|
|
}
|
|
|
|
apply plugin: 'groovy'
|
|
apply plugin: 'org.springframework.boot'
|
|
apply plugin: 'io.spring.dependency-management'
|
|
apply plugin: 'maven-publish'
|
|
|
|
dependencyManagement {
|
|
imports {
|
|
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$BOM_VERSION"
|
|
mavenBom "org.springframework.cloud:spring-cloud-contract-dependencies:${project.findProperty('verifierVersion') ?: verifierVersion}"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("org.springframework.boot:spring-boot-starter-web")
|
|
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
|
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
|
|
|
|
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-restdocs:0.0.1:stubs"
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
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()
|
|
}
|
|
}
|
|
}
|
|
}
|