-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
134 lines (112 loc) · 4.08 KB
/
build.gradle
File metadata and controls
134 lines (112 loc) · 4.08 KB
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
plugins {
id 'java'
id 'jacoco'
// id 'org.graalvm.buildtools.native' version '0.9.28'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.springframework.boot.experimental.thin-launcher' version '1.0.31.RELEASE'
}
if (project.hasProperty('projVersion')) {
project.version = project.projVersion
} else {
project.version = '1.0.1'
}
group = 'uk.mcga.smart'
repositories {
maven {
url 'https://mcga-009543623063.d.codeartifact.eu-west-2.amazonaws.com/maven/mcga-maven/'
credentials {
username 'aws'
password System.env.CODEARTIFACT_AUTH_TOKEN
}
}
}
publishing {
repositories {
maven {
url = 'https://mcga-009543623063.d.codeartifact.eu-west-2.amazonaws.com/maven/mcga-maven/'
credentials {
username 'aws'
password System.env.CODEARTIFACT_AUTH_TOKEN
}
}
}
publications {
bootJava(MavenPublication) {
artifact bootJar
}
}
}
dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.cloud:spring-cloud-function-adapter-aws'
implementation 'org.springframework.cloud:spring-cloud-function-context'
implementation 'org.springframework.cloud:spring-cloud-starter-function-web'
implementation 'org.springframework.cloud:spring-cloud-function-web'
implementation 'org.springframework.retry:spring-retry:2.0.5'
implementation 'org.apache.commons:commons-lang3'
implementation 'uk.mcga.smart.lambda:lambda-okta-base:1.0.10'
implementation 'com.amazonaws.secretsmanager:aws-secretsmanager-caching-java:2.0.0'
// Libraries for json logging
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'ch.qos.logback:logback-classic'
implementation 'org.codehaus.janino:janino:3.1.10'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
java {
sourceCompatibility = JavaVersion.VERSION_17
}
assemble.dependsOn = [thinJar, shadowJar]
shadowJar.mustRunAfter thinJar
import com.github.jengelman.gradle.plugins.shadow.transformers.*
shadowJar {
archiveClassifier = 'aws'
manifest {
inheritFrom(project.tasks.thinJar.manifest)
}
// Required for Spring
mergeServiceFiles()
append 'META-INF/spring.handlers'
append 'META-INF/spring.schemas'
append 'META-INF/spring.tooling'
append 'META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports'
append 'META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports'
transform(PropertiesFileTransformer) {
paths = ['META-INF/spring.factories']
mergeStrategy = 'append'
}
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy jacocoTestReport // report is always generated after tests run
testLogging {
events('PASSED', 'SKIPPED', 'FAILED')
}
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}
// tasks.named('bootBuildImage') {
// builder = 'paketobuildpacks/builder-jammy-tiny:latest'
// imageName = "009543623063.dkr.ecr.eu-west-2.amazonaws.com/${rootProject.name}:${version}"
// }