-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
110 lines (99 loc) · 3.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
buildscript {
ext {
springBootVersion = '1.5.4.RELEASE'
// jacoco version 설정.
jacocoVersion = '0.8.7'
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
// sonarQube plugin 설정.
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"
}
}
plugins {
id 'org.springframework.boot' version '2.7.2'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'java'
}
apply plugin: 'org.sonarqube'
apply plugin: 'jacoco'
group = 'com.ll.exam'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
testImplementation 'org.assertj:assertj-core:3.20.2'
testImplementation 'junit:junit'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
implementation 'org.commonmark:commonmark:0.19.0'
implementation 'mysql:mysql-connector-java'
}
// jacoco 버전 설정.
jacoco{
toolVersion = "${jacocoVersion}"
}
// 어떤 형태로 출력을 할 지.
jacocoTestReport {
reports{
html.enabled=true
xml.enabled=true
csv.enabled=true
}
}
// 한글 파일이나 데이터들을 들어왔을 때 인코딩 해주는 설정.
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.named('test') {
useJUnitPlatform()
}
// sonarQube run :
// docker run --name sonarqube -d -p 9000:9000 sonarqube:latest
// sonarQube 에 대한 내용.
sonarqube {
properties {
// Spring boot 라는 projectName 명시.
property "sonar.projectName","SpringBoot Code Coverage Demo"
property "sonar.exclusions", "**/generated-*/**/*"
property "sonar.projectKey", "org.sonarqubeJacocoCodeCoverage"
property "sonar.reportPath" , "${project.buildDir}/jacoco/test.exec"
// sonarQube 에 대한 URL 설정.
property "sonar.host.url", "http://43.201.86.12:9000"
// 해당 sonarQube src 파일 설정.
property "sonar.sources", "src/main/java"
// 해당 sonarQube test 파일 설정.
property "sonar.tests", "src/test/java"
// 해당 sonarQube 의 계정 설정.
property "sonar.login", "test"
property "sonar.password", "test"
}
}
tasks['sonarqube'].dependsOn test