1- apply plugin : ' spring-cloud-contract'
2- apply plugin : ' maven-publish'
3-
4- group = ' io.reflectoring'
5- version = ' 1.0.0'
6-
7-
81buildscript {
92 repositories {
103 mavenLocal()
114 mavenCentral()
12- maven { url " http://repo.spring.io/snapshot" }
13- maven { url " http://repo.spring.io/milestone" }
14- maven { url " http://repo.spring.io/release" }
155 }
166 dependencies {
177 classpath " org.springframework.boot:spring-boot-gradle-plugin:${ springboot_version} "
18- classpath " org.springframework.cloud:spring-cloud-contract-gradle-plugin:${ verifier_version } "
19- classpath " org.springframework.cloud:spring-cloud-contract-spec-pact:${ verifier_version } "
8+ classpath " org.springframework.cloud:spring-cloud-contract-gradle-plugin:${ springcloudcontract_version } "
9+ classpath " org.springframework.cloud:spring-cloud-contract-spec-pact:${ springcloudcontract_pact_version } "
2010 classpath ' au.com.dius:pact-jvm-model:2.4.18'
2111 }
2212}
2313
24-
2514repositories {
2615 mavenLocal()
2716 mavenCentral()
28- jcenter()
29- maven { url " http://repo.spring.io/snapshot" }
30- maven { url " http://repo.spring.io/milestone" }
31- maven { url " http://repo.spring.io/release" }
17+ }
18+
19+ apply plugin : ' java'
20+ apply plugin : ' org.springframework.boot'
21+ apply plugin : ' io.spring.dependency-management'
22+ apply plugin : ' spring-cloud-contract'
23+ apply plugin : ' maven-publish'
24+
25+ group = ' io.reflectoring'
26+ version = ' 1.0.0'
27+
28+ dependencyManagement {
29+ imports {
30+ mavenBom " org.springframework.cloud:spring-cloud-dependencies:${ springcloud_version} "
31+ }
3232}
3333
3434dependencies {
35- compile(" org.springframework.boot:spring-boot-starter-data-jpa: ${ springboot_version } " )
36- compile(" org.springframework.boot:spring-boot-starter-web: ${ springboot_version } " )
35+ compile(" org.springframework.boot:spring-boot-starter-data-jpa" )
36+ compile(" org.springframework.boot:spring-boot-starter-web" )
3737 compile(' com.h2database:h2:1.4.196' )
3838 testCompile(' org.codehaus.groovy:groovy-all:2.4.6' )
39- testCompile(" org.springframework.cloud:spring-cloud-starter-contract-verifier: ${ verifier_version } " )
40- testCompile(" org.springframework.cloud:spring-cloud-contract-spec:${ verifier_version } " )
41- testCompile(" org.springframework.boot:spring-boot-starter-test: ${ springboot_version } " )
39+ testCompile(" org.springframework.cloud:spring-cloud-starter-contract-verifier" )
40+ testCompile(" org.springframework.cloud:spring-cloud-contract-spec:${ springcloudcontract_pact_version } " )
41+ testCompile(" org.springframework.boot:spring-boot-starter-test" )
4242}
4343
4444contracts {
4545 baseClassMappings {
4646 baseClassMapping(" .*userservice.*" , " io.reflectoring.UserServiceBase" )
4747 }
48- }
48+ }
49+
50+ // a hack to locally publish the contract stubs when executing the build task
51+ // so that it works in the CI build without a Nexus or Artifactory server
52+ build. doLast {
53+ tasks. generatePomFileForStubsPublication. execute()
54+ tasks. publishStubsPublicationToMavenLocal. execute()
55+ }
0 commit comments