From e43e59fce18a21a43c01151798c0173f029da3eb Mon Sep 17 00:00:00 2001 From: Chris Egerton Date: Mon, 12 Sep 2022 12:33:13 -0400 Subject: [PATCH] KAFKA-14198: Define separate configuration for Swagger (#12616) Reviewers: Ismael Juma --- build.gradle | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e2efd4cc634..113aae7605b 100644 --- a/build.gradle +++ b/build.gradle @@ -2535,6 +2535,10 @@ project(':connect:json') { } project(':connect:runtime') { + configurations { + swagger + } + archivesBaseName = "connect-runtime" dependencies { @@ -2564,7 +2568,9 @@ project(':connect:runtime') { implementation libs.mavenArtifact implementation libs.swaggerAnnotations - compileOnly libs.swaggerJaxrs2 + // We use this library to generate OpenAPI docs for the REST API, but we don't want or need it at compile + // or run time. So, we add it to a separate configuration, which we use later on during docs generation + swagger libs.swaggerJaxrs2 testImplementation project(':clients').sourceSets.test.output testImplementation project(':core') @@ -2653,9 +2659,9 @@ project(':connect:runtime') { } task genConnectOpenAPIDocs(type: io.swagger.v3.plugins.gradle.tasks.ResolveTask, dependsOn: setVersionInOpenAPISpec) { - classpath = sourceSets.main.compileClasspath + sourceSets.main.runtimeClasspath + classpath = sourceSets.main.runtimeClasspath - buildClasspath = classpath + buildClasspath = classpath + configurations.swagger.asCollection() outputFileName = 'connect_rest' outputFormat = 'YAML' prettyPrint = 'TRUE'