-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
137 lines (116 loc) · 4.32 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
// https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/2.3.5.RELEASE/spring-boot-dependencies-2.3.5.RELEASE.pom
plugins {
id 'java'
id 'groovy'
id "jacoco"
id 'org.springframework.boot' version "2.3.5.RELEASE"
id 'io.spring.dependency-management' version "1.0.10.RELEASE"
id "com.avast.gradle.docker-compose" version "0.14.0"
id "com.gorylenko.gradle-git-properties" version "2.2.4"
id "com.palantir.git-version" version "0.12.3"
id "org.sonarqube" version "3.0"
id "org.openapi.generator" version "5.0.0"
}
version = gitVersion()
sourceCompatibility = 15
group = "com.github.mwierzchowski.dummy" // TODO change group name
description = "Template project for microservices" // TODO change service description
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Hoxton.SR9"
mavenBom "org.spockframework:spock-bom:1.3-groovy-2.5"
}
}
ext {
schemaName = project.name.replace('-', '_')
springBootAdminVersion = "2.3.1"
mapStructVersion = "1.4.1.Final"
springDocVersion = "1.5.0"
shedlockVersion = "4.15.1"
p6spyVersion = "1.6.2"
swaggerAnnotationsVersion = "1.5.22"
findbugsJsr305Version = "3.0.2"
resilience4jVersion = "1.6.1"
playtikaVersion = "2.0.3"
}
dependencies {
// Web Application
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation "org.springdoc:springdoc-openapi-webmvc-core:$springDocVersion"
implementation "javax.inject:javax.inject:1"
// Database
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation "org.postgresql:postgresql"
implementation "org.liquibase:liquibase-core"
implementation "com.github.gavlyukovskiy:p6spy-spring-boot-starter:$p6spyVersion"
testImplementation "com.playtika.testcontainers:embedded-postgresql:$playtikaVersion"
// Redis
implementation "org.springframework.boot:spring-boot-starter-data-redis"
testImplementation "com.playtika.testcontainers:embedded-redis:$playtikaVersion"
// Scheduler lock
implementation "net.javacrumbs.shedlock:shedlock-spring:$shedlockVersion"
implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:$shedlockVersion"
// Resilience
implementation "io.github.resilience4j:resilience4j-spring-boot2:$resilience4jVersion"
// Rest clients
implementation "io.swagger:swagger-annotations:$swaggerAnnotationsVersion"
implementation "com.google.code.findbugs:jsr305:$findbugsJsr305Version"
testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock"
// Lombok
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
// MapStruct
annotationProcessor "org.mapstruct:mapstruct-processor:$mapStructVersion"
implementation "org.mapstruct:mapstruct:$mapStructVersion"
// Management
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
implementation "de.codecentric:spring-boot-admin-starter-client:$springBootAdminVersion"
// General testing
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation "org.spockframework:spock-spring"
// Development
developmentOnly 'org.springframework.boot:spring-boot-devtools'
}
tasks.withType(ProcessResources) {
filesMatching(['**/*.yml', '**/*.sql']) {
expand(project.properties)
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
task sunriseSunsetGenerate(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
def sourcesRoot = "$buildDir/generated/sources/sunrise-sunset"
inputSpec = "$rootDir/etc/sunrise-sunset-spec.yml"
outputDir = sourcesRoot
generatorName = "java"
library = "resttemplate"
configOptions = [
apiPackage: "org.sunrisesunset.api",
modelPackage: "org.sunrisesunset.model",
invokerPackage: "org.sunrisesunset.invoker",
dateLibrary: "java8"
]
sourceSets.main.java.srcDirs += "$sourcesRoot/src/main/java"
compileJava.dependsOn tasks.sunriseSunsetGenerate
}
dockerCompose {
projectName = project.name
dockerComposeWorkingDirectory = "$rootDir/etc"
}
bootRun {
environment = [
"spring.profiles.active": "debug",
"location.latitude": 52.23,
"location.longitude": 21.01
]
}