-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
152 lines (126 loc) · 4.16 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
plugins {
java
id("org.springframework.boot") version "3.4.1"
id("io.spring.dependency-management") version "1.1.7"
jacoco
id("org.sonarqube") version "6.0.1.5171"
id("com.github.ben-manes.versions") version "0.51.0"
id ("org.openapi.generator") version "7.10.0"
}
group = "it.gov.pagopa.payhub"
version = "0.0.1"
java {
sourceCompatibility = JavaVersion.VERSION_21
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2024.0.0")
}
}
val springDocOpenApiVersion = "2.7.0"
val janinoVersion = "3.1.12"
val openApiToolsVersion = "0.2.6"
val wiremockVersion = "3.10.0"
val hibernateValidatorVersion = "8.0.2.Final"
val micrometerVersion = "1.4.1"
val commonsIoVersion = "2.18.0"
val bouncycastleVersion = "1.79"
dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("io.micrometer:micrometer-tracing-bridge-otel:$micrometerVersion")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:$springDocOpenApiVersion")
implementation("org.codehaus.janino:janino:$janinoVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("org.openapitools:jackson-databind-nullable:$openApiToolsVersion")
implementation ("org.springframework.cloud:spring-cloud-starter-openfeign")
implementation("org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion")
implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
implementation("org.springframework.cloud:spring-cloud-starter-stream-kafka")
//security
implementation("org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion")
// Security Fixes
implementation("commons-io:commons-io:$commonsIoVersion")
// Testing
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-engine")
testImplementation("org.mockito:mockito-core")
testImplementation ("org.projectlombok:lombok")
testImplementation ("org.wiremock:wiremock-standalone:$wiremockVersion")
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
}
tasks.withType<Test> {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required = true
}
}
val projectInfo = mapOf(
"artifactId" to project.name,
"version" to project.version
)
tasks {
val processResources by getting(ProcessResources::class) {
filesMatching("**/application.yml") {
expand(projectInfo)
}
}
}
configurations {
compileClasspath {
resolutionStrategy.activateDependencyLocking()
}
}
tasks.compileJava {
dependsOn("dependenciesBuild")
}
tasks.register("dependenciesBuild") {
group = "AutomaticallyGeneratedCode"
description = "grouping all together automatically generate code tasks"
dependsOn(
"openApiGenerate"
)
}
configure<SourceSetContainer> {
named("main") {
java.srcDir("$projectDir/build/generated/src/main/java")
}
}
springBoot {
mainClass.value("it.gov.pagopa.payhub.ionotification.IONotificationApplication")
}
openApiGenerate {
generatorName.set("spring")
inputSpec.set("$rootDir/openapi/p4pa-io-notification.openapi.yaml")
outputDir.set("$projectDir/build/generated")
apiPackage.set("it.gov.pagopa.payhub.ionotification.controller.generated")
modelPackage.set("it.gov.pagopa.payhub.ionotification.dto.generated")
configOptions.set(mapOf(
"dateLibrary" to "java8",
"requestMappingMode" to "api_interface",
"useSpringBoot3" to "true",
"interfaceOnly" to "true",
"useTags" to "true",
"useBeanValidation" to "true",
"generateConstructorWithAllArgs" to "true",
"generatedConstructorWithRequiredArgs" to "true",
"additionalModelTypeAnnotations" to "@lombok.Builder"
))
}