Define separate configuration for Swagger
Reviewers: Ismael Juma
@@ -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'
