I have a gradle project that acts like a common library for two other projects.
The other two projects each hosts an embedded maven repository that I want the common project to deploy to.
I've tried this:
uploadArchives {
repositories {
mavenDeployer {
repositories {
repository(url: '../../../project-web-service/repo')
repository(url: '../../../project-app/repo')
}
}
}
}
But this only deploys to the second repo.
I have read Configuring multiple upload repositories in Gradle build, but it doesn't cover the mavenDeployer, so I'm kind of stuck right now.
You can create two your own tasks (extends from Upload
), just like this:
task uploadFirst(type: Upload) {
uploadDescriptor = true
repositories {
mavenDeployer {
repositories {
repository(url: '../../../project-web-service/repo')
}
}
}
}
task uploadSecond(type: Upload) {
uploadDescriptor = true
repositories {
mavenDeployer {
repositories {
repository(url: '../../../project-app/repo')
}
}
}
}
I had the same issue and was just able to solve it by giving the additional repositories names, but still leaving their own mavenDeployer closure.
For your example:
uploadArchives {
repositories {
mavenDeployer {
name = 'WebService'
repository(url: '../../../project-web-service/repo')
}
mavenDeployer {
name = 'App'
repository(url: '../../../project-app/repo')
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With