springdoc-openapi-gradle-plugin
springdoc-openapi-gradle-plugin copied to clipboard
Build failed with dependency exception
On a project with internal Gradle module dependencies, the generateOpenApiDocs fails with the following message.
> Task :apps:private-api:forkedSpringBootRun FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Some problems were found with the configuration of task ':xxx:forkedSpringBootRun' (type 'JavaExecFork').
- Gradle detected a problem with the following location: 'xxx/xxx.jar'.
Reason: Task ':xxx:forkedSpringBootRun' uses this output of task ':xxx:jar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
The problem appears only on the first generation after a clean task, so the problem breaks the CI.
It seems to come from a missing dependency with the task assemble.
A workaround is to add the following config to your build.gradle.
tasks.named('forkedSpringBootRun') {
dependsOn('assemble')
}