Skip to content

Commit e058227

Browse files
Add jib and shadow plugins to the build.gradle
1 parent 7f868dd commit e058227

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

JShellAPI/build.gradle

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ plugins {
22
id 'java'
33
id 'org.springframework.boot' version '3.0.1'
44
id 'io.spring.dependency-management' version '1.1.0'
5+
id 'com.google.cloud.tools.jib' version '3.3.2'
6+
id 'com.github.johnrengelman.shadow' version '8.1.1'
57
}
68

79
group 'org.togetherjava'
@@ -19,6 +21,29 @@ dependencies {
1921
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
2022
}
2123

24+
var outputImage = 'togetherjava.org:5001/togetherjava/jshellbackend:master' ?: 'latest'
25+
26+
jib {
27+
from.image = 'eclipse-temurin:19'
28+
to {
29+
image = outputImage
30+
auth {
31+
username = System.getenv('ORG_REGISTRY_USER') ?: ''
32+
password = System.getenv('ORG_REGISTRY_PASSWORD') ?: ''
33+
}
34+
}
35+
container {
36+
mainClass = 'org.togetherjava.jshellapi.Main'
37+
setCreationTime(java.time.Instant.now().toString())
38+
}
39+
}
40+
41+
shadowJar {
42+
archiveBaseName.set('JShellPlaygroundBackend')
43+
archiveClassifier.set('')
44+
archiveVersion.set('')
45+
}
46+
2247
tasks.named('test') {
2348
useJUnitPlatform()
24-
}
49+
}

0 commit comments

Comments
 (0)