File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/main/kotlin/org/springdoc/openapi/gradle/plugin Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,6 @@ const val DEFAULT_WAIT_TIME_IN_SECONDS = 30
14
14
15
15
const val SPRING_BOOT_PLUGIN = " org.springframework.boot"
16
16
const val PROCESS_PLUGIN = " com.github.johnrengelman.processes"
17
+
18
+ const val PROPS_LAUNCHER_CLASS = " org.springframework.boot.loader.PropertiesLauncher"
19
+ const val CLASS_PATH_PROPERTY_NAME = " java.class.path"
Original file line number Diff line number Diff line change
1
+ @file:Suppress(" unused" )
2
+
1
3
package org.springdoc.openapi.gradle.plugin
2
4
3
5
import org.gradle.api.Plugin
@@ -30,7 +32,8 @@ open class OpenApiGradlePlugin : Plugin<Project> {
30
32
31
33
fork.onlyIf {
32
34
val bootJar = bootJarTask.get().outputs.files.first()
33
- fork.commandLine = listOf (" java" , " -jar" ) + extractProperties(extension.forkProperties) + listOf (" $bootJar " )
35
+ fork.commandLine = listOf (" java" , " -cp" ) +
36
+ listOf (" $bootJar " ) + extractProperties(extension.forkProperties) + listOf (PROPS_LAUNCHER_CLASS )
34
37
true
35
38
}
36
39
}
@@ -56,8 +59,10 @@ open class OpenApiGradlePlugin : Plugin<Project> {
56
59
is String -> element
57
60
.split(" -D" )
58
61
.filter { it.isNotEmpty() }
62
+ .filterNot { it.startsWith(CLASS_PATH_PROPERTY_NAME , true ) }
59
63
.map { " -D${it.trim()} " }
60
64
is Properties -> element
65
+ .filterNot { it.key.toString().startsWith(CLASS_PATH_PROPERTY_NAME , true ) }
61
66
.map { " -D${it.key} =${it.value} " }
62
67
else -> {
63
68
logger.warn(" Failed to use the value set for 'forkProperties'. Only String and Properties objects are supported." )
You can’t perform that action at this time.
0 commit comments