hi all,
I have a legacy java (web) application built with gradle. it creates multiple artifacts, but is not multi-module for historic reasons. the artifacts are introduced using java { registerFeature(…) } and extra sourcesets. we are also leveraging testFixtures which also produces an artifact. for all artifacts, ‘withSourcesJar()’ and ‘withJavadocJar()’ is used.
the artifacts are the published to a private repository using maven-publish. also some extra artifacts produced by some custom jar tasks are published to that repository.
the artifacts from that repository can successfully be consumed by other projects. the variants can be referenced using capabilities {requireCapability(…)}. the thirdparty-dependencies are automatically resolved in the consuming projects.
I now need to publish the main artifacts (jar, secondJar, testFixturesJar) to another (semi-private) repository - but WITHOUT the sources (because of the ‘semi’), but keeping the full consuming capabilities. consumers might be maven or gradle projects.
I’m aware of Customizing publishing which is kind of describing my exact requirement - but - as far as I understand - this would need to remove withSourcesJar() (because otherwise “from components.java” will auto-include everything in my single publication) and introducing the source-tasks again manually. And the dependencies are also not published with the described solution. I’d need to manually describe pom{withXml…} which feels kind of awkward.
I assume my requirements, having ‘private’ sources, are not that exotic. what’s the cleanest, gradle-likest solution for this?
br
gerhard