-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publishing fails for Open-Api artifacts generated with spring-doc #171
Comments
cgrabmann
added a commit
that referenced
this issue
Aug 22, 2023
* we work around this by creating a dummy directory which we will use as a working directory for the forked spring bootRun task. Because some other tasks also seem to use this directory we also make them depend on this task. But that list might be incomplete. Signed-off-by: Clemens Grabmann <[email protected]>
cgrabmann
added a commit
that referenced
this issue
Aug 22, 2023
…#172) * we work around this by creating a dummy directory which we will use as a working directory for the forked spring bootRun task. Because some other tasks also seem to use this directory we also make them depend on this task. But that list might be incomplete. Signed-off-by: Clemens Grabmann <[email protected]>
for now I implemented a workaround that configures the working directory for the forked spring boot run to be some dummy directory that does not have any content, therefore this error does no longer happen. But a fix in the plugins themselves would still be preferred. |
rspiegl
added a commit
that referenced
this issue
Jun 25, 2024
rspiegl
added a commit
that referenced
this issue
Jun 25, 2024
…pi-plugin Signed-off-by: Rick Spiegl <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The integration of the
org.springdoc:springdoc-openapi-gradle-plugin
Plugin runs into a problem while publishing an artifact.Running the
clfGenerateOpenApiDocumentation
task and therefore thegenerateOpenApiDocs
task on their own works without issues.But if the
generateOpenApiDocs
task is run during publishing it results in an error similar to this:This happens because the
springdoc-openapi-gradle-plugin
uses thegradle-execfork-plugin
to start the spring-boot application. But thegradle-execfork-plugin
declares the working directory as@InputDirectory
which causes gradle to track all tasks creating files in the build-directory and then assumes that theforkedSpringBootRun
is wrongly configured, since it has those files as input but does not declare a dependency on the generating tasks. This is already tracked in this issue.As a workaround for now we can disable state tracking for the
forkedSpringBootRun
task. But this also disables gradle caching and might have undesirable consequences since the job might be run even if it does not need to, resulting in way longer build times then necessary.We can try to make sure that the open-api documentation generation is only depended on when a publish task is run, but this only solves the issue for projects that do not manage its frontend in the same project. Projects which generate the frontend-api inside the same project will depend on the generated api-spec artifact and therefore run its generation every time the frontend is build.
Another workaround might be to use a dummy working directory for the
forkedSpringBootRun
task. But this might cause the spring boot application to not start correctly and therefore failing to generate the api-spec completely.The text was updated successfully, but these errors were encountered: