Composite Build + Maven Publish Missing Dependency Version

I have a set of projects that I am trying to use within a composite build, while still publishing them as individual libraries to an artifactory.

- build-logic 
- models // includeBuild build-logic
- clients // includeBuild build-logic and models

When attempting to publish the artifact from the clients build, the resulting POM/module is missing a dependency version for the models library.

    <dependency> <!-- missing the version -->

Is this is related to the known lack of support for maven-publish?
Or are composite builds really meant to support a “main” executable project? Whereas I am trying to create non-executable libraries to be published.

I am in the same situation, having tried to convert my library project to use composite build and the example build-logic/platforms.

It is really neat!

But the documentation (and its example) lacks the description of how to publish the “product-platform” with the product. Sort of like a parent pom (it is mentioned in the created product POM in the dependencyManagement section).

As you say @darthblonderss, it looks like composite builds are not ready for libraries.

It would be really neat if someone (in the know) could tell if this is something that could/would be fixed.

To me, it seems that “just” being able to publish a POM for the product-platform would fix this particular use case.


It seems to be possible after all, looking at the platform documentation.

I had already added a publishing block that did not seem to have an effect.
But that was just because the includeBuild does not execute publish tasks in the included builds.
In hindsight, this is obvious. Duh!

Running this explicitly provides me with a parent POM in MavenLocal:

./gradlew :platforms:openapi-jaxrs-parent:publishToMavenLocal

(I have renamed product-platform to the more normal -parent for my project)

I still have some work to do, but now believe it can be made to work.