According to the APi documentation, RepositoryHandler.mavenDeployer will add a new MavenDeployer for each call*. I’m in a situation in which I want to define the default MavenDeployer behaviour in the root project and then tweak it for certain subprojects in their respective build scripts.
Then in a subproject I do this: (because the project name is good for the IDE, but for historic reasons the artifactId is different)
mavenDeployerRef.pom.artifactId = '...'
Another pain point is that I haven’t found a way to remove the jar artifact from archives if my upload artifact is a zip. The archives set is, IIRC, an UnmodifiableSet, so I can’t remove anything from as it (as was suggested in an old mailing list archive post). The war plugin does something to avoid this, but I haven’t dug into the code.
Anyway, the solution I’m left with is ugly, and forces me to define the artifactId yet again (as I defined the conventional in the root project):
mavenDeployerRef.pom('zip').artifactId = '...'
If I don’t define it I get this error:
A POM cannot have multiple artifacts with the same type and classifier.
That’s everything. Am I missing some ways to improve on this? Cheers!
I’ve found a way to remove the jar from the archives. It’s using the deprecated removeArtifact method but works with the current 1.0-milestone-5 snapshot: