I am using maven plugin for uploading artifacts to repository.
We have used two configurations to upload file into multiple repositories.
Configuration archives
is used to upload jar files to repository 1.
Configuration apispec
is used to upload json files to repository 2.
used below line to upload json using apispec.
def jsonArtifact = new DefaultPublishArtifact(file.getName(), "json", "json", null, new Date(), file) configurations.apiSpecs.getArtifacts().add(jsonArtifact)
or
apiSpecs file: file, name: file.getName(), type: 'json'
But this adding artifact to the apiSpecs
and archives
configuration as well. Due to that file is getting uploaded to both repositories.
Could someone guide me on this? Thanks