103 lines
2.3 KiB
Groovy
103 lines
2.3 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
maven { url "http://repo.spring.io/snapshot" }
|
|
maven { url "http://repo.spring.io/milestone" }
|
|
maven { url "http://repo.spring.io/release" }
|
|
}
|
|
dependencies {
|
|
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT"
|
|
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
|
}
|
|
}
|
|
|
|
group = 'com.example'
|
|
version = '0.0.1-SNAPSHOT'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
maven { url "http://repo.spring.io/snapshot" }
|
|
maven { url "http://repo.spring.io/milestone" }
|
|
maven { url "http://repo.spring.io/release" }
|
|
}
|
|
|
|
apply plugin: 'groovy'
|
|
apply plugin: 'spring-boot'
|
|
apply plugin: 'spring-cloud-contract'
|
|
apply plugin: 'maven-publish'
|
|
|
|
dependencyManagement {
|
|
imports {
|
|
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$BOM_VERSION"
|
|
}
|
|
}
|
|
|
|
ext {
|
|
stubsOutputDirRoot = file("${project.buildDir}/stubs/")
|
|
}
|
|
|
|
contracts {
|
|
baseClassMappings {
|
|
baseClassMapping('.*', 'com.example.source.SensorSourceTestBase')
|
|
}
|
|
stubsOutputDir = stubsOutputDirRoot
|
|
}
|
|
|
|
dependencies {
|
|
compile("org.springframework.boot:spring-boot-starter-web")
|
|
compile("org.springframework.boot:spring-boot-starter-actuator")
|
|
compile("org.springframework.cloud:spring-cloud-starter-stream-rabbit")
|
|
|
|
testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
|
|
testCompile("org.springframework.cloud:spring-cloud-stream-test-support")
|
|
}
|
|
|
|
task stubsJar(type: Jar, dependsOn: "generateWireMockClientStubs") {
|
|
baseName = "${project.name}"
|
|
classifier = "stubs"
|
|
from stubsOutputDirRoot
|
|
}
|
|
|
|
artifacts {
|
|
archives stubsJar
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
stubs(MavenPublication) {
|
|
artifactId "${project.name}"
|
|
artifact stubsJar
|
|
}
|
|
}
|
|
}
|
|
|
|
test {
|
|
systemProperty 'spring.profiles.active', 'gradle'
|
|
testLogging {
|
|
exceptionFormat = 'full'
|
|
}
|
|
}
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = '2.14'
|
|
}
|
|
|
|
clean.doFirst {
|
|
delete "~/.m2/repository/com/example/stream-source-gradle"
|
|
}
|
|
|
|
task resolveDependencies {
|
|
doLast {
|
|
project.rootProject.allprojects.each { subProject ->
|
|
subProject.buildscript.configurations.each { configuration ->
|
|
configuration.resolve()
|
|
}
|
|
subProject.configurations.each { configuration ->
|
|
configuration.resolve()
|
|
}
|
|
}
|
|
}
|
|
}
|