Application run failed: IllegalStateException - No Docker Compose file found
The application fails to run after updating to version 1.9.0 of the org.springdoc.openapi-gradle-plugin. The error indicates that no Docker Compose file is found in the specified directory.
Error Log
2024-07-02T09:58:32.472Z ERROR 2938 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: No Docker Compose file found in directory '/home/runner/work/app/build/tmp/forkedSpringBootRun/.'
Previous Configuration (version 1.8.0):
openApi {
groupedApiMappings.set([
"http://localhost:8080/v3/api-docs.yaml/event1" : "event1.yaml",
"http://localhost:8080/v3/api-docs.yaml/event2" : "event2.yaml",
])
customBootRun {
args = ["--spring.profiles.active=local"]
}
}
Environment:
Plugin version: 1.9.0 Previous working version: 1.8.0 Java version: 21 Gradle version: 8.5
cause is this change https://github.com/springdoc/springdoc-openapi-gradle-plugin/pull/142
getting the behaviour from before can be achieved by setting the workingDir
for us this did the trick
customBootRun {
workingDir.set(project.rootProject.projectDir)
args.set(["--spring.profiles.active=local"])
}
for more context: only happens due to some interaction with this dependency developmentOnly "org.springframework.boot:spring-boot-docker-compose"
This is most likely a problem with compose.yaml not being copied to the build/tmp directory which is now set for forkedSpringBootRun. This is solvable by pointing to the compose.yaml explicitly:
// Kotlin DSL
openApi {
customBootRun {
systemProperties = mapOf("spring.docker.compose.file" to "${projectDir}/compose.yaml")
}
}