-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
89 lines (73 loc) · 2.2 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
plugins {
id 'org.springframework.boot' version '2.5.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'de.undercouch.download' version '4.1.2'
id 'org.jetbrains.gradle.plugin.idea-ext' version '0.5'
id 'io.openapiprocessor.openapi-processor' version '2021.3'
id 'java'
}
group = 'de.codecentric'
version = '0.0.2-SNAPSHOT'
sourceCompatibility = '11'
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.7.2')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.7.2')
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
}
test {
useJUnitPlatform()
}
task downloadFile(type: Download) {
src "https://raw.githubusercontent.com/codecentric/api-showcases/main/specs/news.yaml"
dest "${projectDir}/src/api"
onlyIfModified true
useETag true
}
openapiProcessor {
spring {
processor 'io.openapiprocessor:openapi-processor-spring:2021.4'
apiPath "$projectDir/src/api/news.yaml"
targetDir "$projectDir/build/openapi"
mapping "$projectDir/mapping.yaml"
showWarnings true
}
}
afterEvaluate {
tasks.processSpring.dependsOn(tasks.downloadFile)
}
sourceSets {
main {
java {
srcDir "build/openapi"
}
}
test {
resources {
srcDir file('src/test/java')
exclude '**/*.java'
}
}
}
compileJava.dependsOn('processSpring')
springBoot {
mainClassName = "de.codecentric.apifirstspringboot.ApifirstSpringbootApplication"
}