-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
136 lines (111 loc) · 3.79 KB
/
build.gradle.kts
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
plugins {
kotlin("jvm") version "1.9.25"
kotlin("plugin.spring") version "1.9.25"
id("org.springframework.boot") version "3.3.3"
id("io.spring.dependency-management") version "1.1.6"
id("org.sonarqube") version "5.0.0.4638"
jacoco
}
group = "com.zufar"
version = "0.0.1"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
sonar {
properties {
property("sonar.projectKey", "shorty-url")
property("sonar.projectName", "ShortyURL")
}
}
val springCloudVersion = "2023.0.3"
val mockitoVersion = "5.13.0"
val mockitoKotlinVersion = "5.4.0"
val springdocVersion = "2.6.0"
val javaxValidationApiVersion = "2.0.1.Final"
val commonsValidatorVersion = "1.9.0"
val jjwtApiVersion = "0.11.5"
dependencies {
// Spring Boot MVC
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
// Database
implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
// Security
implementation("org.springframework.boot:spring-boot-starter-security")
// JWT
implementation("io.jsonwebtoken:jjwt-api:$jjwtApiVersion")
runtimeOnly("io.jsonwebtoken:jjwt-impl:$jjwtApiVersion")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:$jjwtApiVersion")
// Password Encoding
implementation("org.springframework.security:spring-security-crypto")
// Logging
implementation("org.springframework.boot:spring-boot-starter-logging")
// Jackson
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
// OpenAPI
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:$springdocVersion")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-api:$springdocVersion")
// Validation
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("javax.validation:validation-api:$javaxValidationApiVersion")
implementation("commons-validator:commons-validator:$commonsValidatorVersion")
// Lombok
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
// Testing
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.mockito:mockito-core:$mockitoVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test")
}
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion")
}
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
sonarqube {
properties {
property("sonar.projectKey", "Sunagatov_URL-Shortener")
property("sonar.organization", "zufar")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.login", System.getenv("SHORTY_URL_SONAR_TOKEN"))
property("sonar.sources", "src/main/kotlin")
property("sonar.tests", "src/test/kotlin")
property("sonar.language", "kotlin")
property("sonar.kotlin.detekt.reportPaths", "build/reports/detekt")
property("sonar.jacoco.reportPaths", "${layout.buildDirectory}/jacoco/test.exec")
}
}
tasks.named("sonarqube") {
dependsOn("jacocoTestReport") // Ensure JaCoCo report is generated before SonarCloud analysis
}
sourceSets {
main {
kotlin {
srcDirs("${layout.buildDirectory}/generated/api/src/main/kotlin")
}
}
}
jacoco {
toolVersion = "0.8.10"
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(true)
}
}