I have a multiproject project where the toplevel project has no code. The subprojects produce a jar. The toplevel project zips all jars from subprojects into a distribution zip. All jars are using one global version.
I am trying to support these 2 usecases:
- Developer changed code. Subproject jars should be built and published to local maven repo (%USERPROFILE%.m2\repository)
- Build subproject jars, zip them into a distribution zip and publish it to an external repo.
I created a small test project to show this:
Usecase 2 works fine when I run gradlew publishReleasePublicationToReleasesRepository
For usecase 1 I wanted to define a publication that included the jars from all the subprojects, but I can’t seem to get that to work:
publishing {
publications {
release(MavenPublication) {
artifactId 'testapplication'
artifact distZip
}
// integrations(MavenPublication) {
// artifact subprojects.jar
// }
}
repositories {
maven {
name 'releases'
url "file://$projectDir/../release-repo"
}
}
}
Any suggestions how to get this to work? Am I thinking about this all wrong?