forked from alexandre-touret/rest-apis-versioning-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
188 lines (169 loc) · 7.26 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
plugins {
id 'org.springframework.boot' version "${springBootVersion}"
id 'io.spring.dependency-management' version "${springDependencyManagementVersion}"
id 'java'
id 'idea'
id 'org.openapi.generator' version "${openApiGeneratorVersion}"
}
bootJar {
enabled = false
}
allprojects {
apply plugin: 'java'
apply plugin: 'idea'
group = 'info.touret.bookstore.spring'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
test {
useJUnitPlatform()
}
}
subprojects {
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
dependencies {
developmentOnly 'org.springframework.boot:spring-boot-devtools'
implementation 'io.opentracing.contrib:opentracing-spring-jaeger-cloud-starter:3.3.1'
implementation 'io.micrometer:micrometer-registry-prometheus'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
compileOnly 'org.springframework.boot:spring-boot-devtools'
}
bootJar {
enabled = true
}
}
project(':rest-book') {
apply plugin: 'org.openapi.generator'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'com.h2database:h2'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'io.github.resilience4j:resilience4j-spring-boot2'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation "org.springdoc:springdoc-openapi-ui:${springdocVersion}"
implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
}
openApiValidate {
inputSpec = "$projectDir/src/main/resources/openapi.yml".toString()
recommend = true
}
openApiGenerate {
generatorName = "spring"
library = "spring-boot"
modelNameSuffix = "Dto"
inputSpec = "$projectDir/src/main/resources/openapi.yml".toString()
outputDir = "$buildDir/generated".toString()
apiPackage = "info.touret.bookstore.spring.book.generated.controller"
invokerPackage = "info.touret.bookstore.spring.book.generated.invoker"
modelPackage = "info.touret.bookstore.spring.book.generated.dto"
configOptions = [
dateLibrary : "java8",
java8 : "true",
openApiNullable : "false",
documentationProvider: "springdoc",
useBeanValidation : "true",
interfaceOnly : "true"
]
}
tasks.withType(JavaCompile) {
options.compilerArgs = [
'-Amapstruct.suppressGeneratorTimestamp=true',
'-Amapstruct.suppressGeneratorVersionInfoComment=true',
'-Amapstruct.defaultComponentModel=spring'
]
}
springBoot{
mainClass = "info.touret.bookstore.spring.RestBookstoreApplication"
}
sourceSets.main.java.srcDirs += "$buildDir/generated/src/main/java".toString()
compileJava.dependsOn 'openApiGenerate'
}
project(':rest-number') {
apply plugin: 'org.openapi.generator'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'io.github.resilience4j:resilience4j-spring-boot2'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation "org.springdoc:springdoc-openapi-ui:${springdocVersion}"
implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation "com.github.javafaker:javafaker:${javaFakerVersion}"
implementation "org.yaml:snakeyaml:${snakeYamlVersion}"
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
}
openApiValidate {
inputSpec = "$projectDir/src/main/resources/openapi.yml".toString()
recommend = true
}
openApiGenerate {
generatorName = "spring"
library = "spring-boot"
modelNameSuffix = "Dto"
inputSpec = "$projectDir/src/main/resources/openapi.yml".toString()
outputDir = "$buildDir/generated".toString()
apiPackage = "info.touret.bookstore.spring.number.generated.controller"
invokerPackage = "info.touret.bookstore.spring.number.generated.invoker"
modelPackage = "info.touret.bookstore.spring.number.generated.dto"
configOptions = [
dateLibrary : "java8",
java8 : "true",
openApiNullable : "false",
documentationProvider: "springdoc",
useBeanValidation : "true",
interfaceOnly : "true"
]
}
tasks.withType(JavaCompile) {
options.compilerArgs = [
'-Amapstruct.suppressGeneratorTimestamp=true',
'-Amapstruct.suppressGeneratorVersionInfoComment=true',
'-Amapstruct.defaultComponentModel=spring'
]
}
springBoot{
mainClass = "info.touret.bookstore.spring.number.RestNumbersApplication"
}
sourceSets.main.java.srcDirs += "$buildDir/generated/src/main/java".toString()
compileJava.dependsOn 'openApiGenerate'
}
project(':gateway') {
dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
}
}
project(':config-server') {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-config-server'
}
}
project(':authorization-server') {
dependencies {
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation "org.springframework.security:spring-security-oauth2-authorization-server:${springAuthServerVersion}"
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}
}