-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
81 lines (72 loc) · 2.53 KB
/
Copy pathbuild.gradle
File metadata and controls
81 lines (72 loc) · 2.53 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.6'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.graalvm.buildtools.native' version '0.11.0'
}
group = 'sample'
description = 'spring-boot-native-image'
version = 'latest-25'
bootBuildImage {
environment = [
"BP_JVM_VERSION" : "25",
"BP_NATIVE_IMAGE" : "true",
"BP_NATIVE_IMAGE_BUILD_ARGUMENTS": [
// (default) mostly-static linked executable
"-H:+UnlockExperimentalVMOptions -H:+StaticExecutableWithDynamicLibC",
// no fallback if native-image generation fails
"--no-fallback",
// optimize for host machine
"-march=native",
// Parallel GC: Garbage-First (G1) GC based on Java HotSpot VM
"--gc=parallel",
// min/max heap size for binary, tested by locally with VM options -Xms -Xmx
"-R:MinHeapSize=32m -R:MaxHeapSize=48m",
// -Os: optimizations except those that can increase code or image size significantly
"-Os"
].join(" "),
"BP_BINARY_COMPRESSION_METHOD": "upx",
"BP_RUNTIME_CERT_BINDING_DISABLED": "true"
]
builder = "paketobuildpacks/builder-jammy-buildpackless-tiny"
buildpacks = [
"paketobuildpacks/java-native-image"
]
runImage = "busybox:1.36.1-glibc"
buildCache {
bind {
source.set("/tmp/paketobuildpacks/cache-${rootProject.name}.build")
}
}
launchCache {
bind {
source.set("/tmp/paketobuildpacks/cache-${rootProject.name}.launch")
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.rednoise:rita:2.4.501'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.named('test') {
useJUnitPlatform()
}