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
1414
1515const val SPRING_BOOT_PLUGIN = " org.springframework.boot"
1616const 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+
13package org.springdoc.openapi.gradle.plugin
24
35import org.gradle.api.Plugin
@@ -30,7 +32,8 @@ open class OpenApiGradlePlugin : Plugin<Project> {
3032
3133 fork.onlyIf {
3234 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 )
3437 true
3538 }
3639 }
@@ -56,8 +59,10 @@ open class OpenApiGradlePlugin : Plugin<Project> {
5659 is String -> element
5760 .split(" -D" )
5861 .filter { it.isNotEmpty() }
62+ .filterNot { it.startsWith(CLASS_PATH_PROPERTY_NAME , true ) }
5963 .map { " -D${it.trim()} " }
6064 is Properties -> element
65+ .filterNot { it.key.toString().startsWith(CLASS_PATH_PROPERTY_NAME , true ) }
6166 .map { " -D${it.key} =${it.value} " }
6267 else -> {
6368 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