-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (89 loc) · 2.65 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
plugins {
id 'java'
id 'jacoco'
id 'org.springframework.boot' version "2.4.2"
id 'io.spring.dependency-management' version "1.0.11.RELEASE"
id 'com.palantir.docker' version "0.26.0"
id "com.github.spotbugs" version "4.6.1"
id "com.diffplug.spotless" version "5.10.2"
id 'pmd'
}
group = 'com.example.starwars'
version = '0.0.1-SNAPSHOT'
repositories {
mavenCentral()
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(15)
}
}
jacoco {
toolVersion = "0.8.6"
}
bootJar {
archiveBaseName = 'planet-api'
archiveVersion = '0.0.1-SNAPSHOT'
mainClass = 'com.example.starwars.planetapi.PlanetServiceApplication'
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
task unpack(type: Copy) {
description 'Copies the resource directory to the target directory.'
dependsOn bootJar
from(zipTree(tasks.bootJar.outputs.files.singleFile))
into("build/dependency")
}
docker {
println "Generating docker image ${project.group}/${project.name}"
name "${project.group}/${project.name}"
copySpec.from(tasks.unpack.outputs).into("dependency")
buildArgs(['DEPENDENCY': "dependency"])
}
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore', '.properties', '.yml'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() //Takes an integer argument if you don't like 4
endWithNewline()
}
java {
target 'src/*/java/**/*.java'
importOrder() // standard import order
removeUnusedImports()
// apply a specific flavor of google-java-format
googleJavaFormat('1.9').aosp()
}
}
pmd {
consoleOutput = true
toolVersion = "6.31.0"
rulesMinimumPriority = 5
ruleSets = ["category/java/errorprone.xml", "category/java/bestpractices.xml"]
ignoreFailures = true
}
test {
useJUnitPlatform()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'io.springfox:springfox-boot-starter:3.0.0'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'de.flapdoodle.embed:de.flapdoodle.embed.mongo'
}