This repository was archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
120 lines (100 loc) · 3.24 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
plugins {
jacoco
`java-library`
`maven-publish`
id ("org.sonarqube") version "3.3"
id("io.freefair.lombok") version "6.3.0"
id ("fr.brouillard.oss.gradle.jgitver") version "0.9.1"
}
group = "com.frog-development"
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
}
dependencies {
api("io.jsonwebtoken:jjwt:0.9.1")
implementation("org.springframework.boot:spring-boot-starter-security:2.6.2")
implementation("org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.2")
implementation("ch.qos.logback:logback-classic:1.2.10")
implementation("javax.servlet:javax.servlet-api:4.0.1")
implementation("javax.xml.bind:jaxb-api:2.3.1")
compileOnly("org.jetbrains:annotations:23.0.0")
compileOnly("org.springframework.security:spring-security-test:5.6.1")
testImplementation("org.springframework.boot:spring-boot-starter-test:2.6.2")
testImplementation("org.springframework.security:spring-security-test:5.5.3")
testImplementation("org.junit.platform:junit-platform-runner:1.8.2")
}
tasks.named<Test>("test") {
reports.html.required.set(false)
useJUnitPlatform {
includeTags("unitTest")
excludeTags("integrationTest")
}
finalizedBy(tasks.named("jacocoTestReport"))
}
tasks.named<JacocoReport>("jacocoTestReport") {
dependsOn(tasks.named("test"))
reports {
xml.required.set(true)
// xml.destination file("${buildDir}/reports/jacoco/test.xml")
csv.required.set(false)
html.required.set(false)
}
}
//tasks.named<JacocoCoverageVerification>("jacocoTestCoverageVerification") {
// violationRules {
// rule {
// limit {
// minimum = "0.9".toBigDecimal()
// }
// }
// }
//}
sonarqube {
properties {
// property ("sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/test.xml")
property ("sonar.projectKey", "FrogDevelopment_authorization-jwt-module")
property ("sonar.organization", "frogdevelopment")
property ("sonar.host.url", "https://sonarcloud.io")
}
}
project.tasks["sonarqube"].dependsOn("jacocoTestReport")
java {
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set("Authorisation JWT")
description.set("Handle Spring Security with JWT")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("legall.benoit")
name.set("Benoît Le Gall")
email.set("[email protected]")
}
}
}
}
}
}
tasks.wrapper {
gradleVersion = "7.2"
distributionType = Wrapper.DistributionType.ALL
}
jgitver {
strategy("PATTERN")
versionPattern("\${v}-SNAPSHOT")
tagVersionPattern("\${v}")
}