Skip to content

Commit 7b87982

Browse files
committed
Configure shadowJar Gradle task for spring-analyzer
1 parent dc90d9f commit 7b87982

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

utbot-spring-analyzer/build.gradle.kts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
import com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer
3+
14
plugins {
25
id("org.springframework.boot") version "2.7.8"
36
id("io.spring.dependency-management") version "1.1.0"
7+
id("com.github.johnrengelman.shadow") version "7.1.2"
48
id("java")
9+
application
510
}
611

712
java {
@@ -12,4 +17,21 @@ java {
1217
dependencies {
1318
implementation("org.springframework.boot:spring-boot-starter")
1419
implementation("org.springframework.boot:spring-boot-starter-web")
15-
}
20+
}
21+
22+
application {
23+
mainClass.set("org.utbot.spring.ApplicationRunnerKt")
24+
}
25+
26+
tasks.withType(ShadowJar::class.java) {
27+
isZip64 = true
28+
// Required for Spring
29+
mergeServiceFiles()
30+
append("META-INF/spring.handlers")
31+
append("META-INF/spring.schemas")
32+
append("META-INF/spring.tooling")
33+
transform(PropertiesFileTransformer().apply {
34+
paths = listOf("META-INF/spring.factories")
35+
mergeStrategy = "append"
36+
})
37+
}

0 commit comments

Comments
 (0)