更新时间:2021-12-04 02:36:17
我有类似的问题,在我的情况下这很好用:
I had similar problem, in my situation this works fine:
task pathingJar(type: Jar) {
dependsOn configurations.runtime
appendix = 'pathing'
doFirst {
manifest {
attributes "Class-Path": configurations.runtime.files.collect {it.toURL().toString().replaceFirst("file:/", '/')}.join(" ")
}
}
}
bootRun {
dependsOn pathingJar
doFirst {
classpath = files("$buildDir/classes/main", "$buildDir/resources/main", pathingJar.archivePath)
}
}