I've been reading through old posts trying to figure out how to upload
multiple artifacts from a single subproject in a multiproject build.

Parent build, in "subprojects" section:

uploadArchives {
  repositories.mavenDeployer {
    repository(url: "file://localhost/tmp/testRepo")
     // pom.version, pom.artifactId & pom.groupId set.
  }
}

Only 1 out of a number of subprojects has multiple artifacts that need to be
uploaded. Should the repository url be propogated from the parent, this just
extends the configuration? I get an error "Cause: Could not publish
configurations [configuration ':my-project:archives'].", "Caused by: A
distributionManagement element or remoteRepository element is required to
deploy"

Config in the subproject:

task myTar(type: Tar) {
   // tar stuff
}

artifacts {
  archives myTar
}

// trying to extend the configuration of repositories.mavenDeployer from the
parent's "subprojects" configuration.
uploadArchives {
  repositories.mavenDeployer {
     addFilter('tar') { artifact, file ->
        artifact.name.contains 'some-artifact'
     }
  }
}

Reply via email to