Fix classpath index so entries match those expected by the launcher

This reverts commit ad164269e9 and adds
some additional tests.

Fixes gh-24192
This commit is contained in:
Andy Wilkinson
2021-01-08 14:42:43 +00:00
parent 826d79be3e
commit 5ad4d627fd
13 changed files with 153 additions and 36 deletions

View File

@@ -0,0 +1,25 @@
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
}
repositories {
mavenCentral()
maven { url "file:repository" }
}
dependencies {
implementation("com.example:library:1.0-SNAPSHOT")
implementation("org.apache.commons:commons-lang3:3.9")
}
task explode(type: Sync) {
dependsOn(bootJar)
destinationDir = file("$buildDir/exploded")
from zipTree(files(bootJar).singleFile)
}
task launch(type: JavaExec) {
classpath = files(explode)
main = 'org.springframework.boot.loader.JarLauncher'
}

View File

@@ -0,0 +1,19 @@
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
}
task launch(type: JavaExec) {
classpath = files(bootJar)
}
repositories {
mavenCentral()
maven { url "file:repository" }
}
dependencies {
implementation("com.example:library:1.0-SNAPSHOT")
implementation("org.apache.commons:commons-lang3:3.9")
}