Skip to content

Cyclic gradle task dependency if build configured to include openapi specification file in the build artifact #28

Closed
@tbadgu

Description

@tbadgu

Gradle build file has "$buildDir/docs" path where the spec file will be generated by the plugin configured to be included into build artifact as follows:

openApi {
	apiDocsUrl.set("http://localhost:8080/v3/api-docs")
	outputDir.set(file("$buildDir/docs"))
}

sourceSets {
	main {
		output.dir(builtBy: 'generateOpenApiDocs', '$buildDir/docs')
	}
}

But since forkedSpringBootRun task has a dependency on bootJar task there is no clean way we can incorporate the openapi specification file into the build artifact due to cyclic dependency.

Circular dependency between the following tasks:

:bootJar
+--- :classes
|    \--- :generateOpenApiDocs
|         \--- :forkedSpringBootRun
|              \--- :bootJar (*)
\--- :generateOpenApiDocs (*)

Is there any way this can be achieved?
Please let me know if anymore details are required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions