swagger-gradle-plugin
swagger-gradle-plugin copied to clipboard
attachSwaggerArtifact multi-module build not working
In a multi module build, where only one module generates a swagger doc, and that module's build.gradle specifies attachSwaggerArtifact = true
, I am unable to get the swagger json deployed to artifactory.
Relevant build.gradle:
swagger {
apiSource {
attachSwaggerArtifact = true
outputFormats = ['json']
springmvc = false
locations = ['com.foo.resources']
basePath = '/'
info {
title = rootProject.name
version = rootProject.version
description = rootProject.description
}
swaggerDirectory = "${project.buildDir}/swagger"
securityDefinition {
name = 'Bearer'
type = 'apiKey'
keyLocation = 'header'
// The name of the header
keyName = 'Authorization'
}
modelConverters = [
'io.swagger.validator.BeanValidator',
]
}
}
Please advise.
This may be a peculiarity related to artifactory, however, as the Maven builds (using the maven plugin this plugin is based on) seem to ignore the artifact as well. Artifactory says it will publish all artifacts by default (https://www.jfrog.com/confluence/display/RTF/Working+With+Pipeline+Jobs+in+Jenkins#WorkingWithPipelineJobsinJenkins-GradleBuildswithArtifactory). Perhaps this plugin uses a non-standard publication or pulishConfig? Any thoughts on how to resolve this?
I'm currently on a long holiday and without a computer, so I'll take a look at it when I'm home.
Currently, I've got a branch with a lot of this changed, so may be already fixed. If not, I can always fix it.
To get multiple artifacts created, I have to do some hacking around, so that could also end up being a problem.