Publishing plugin to local repo in composite build does not publish the other jars?

I have a composite build where a plugin depends on a project depends on another project. I need all 3 projects to be published to a local repo during the build as another project at build time uses the plugin to test it out. After all that, I do want to publish all jars in the project and the plugin as well under one version number.

I have a task publishPluginMavenPublicationToWebpiecesLocal2Repository but it only publishes the plugin jar and not the jars it depends on so the plugin will not work in the project using it. What is the best way to get past this first step?

My tentative guess which I don’t know how to do yet is

  • Have build task depend on publishPluginMavenPublicationToWebpiecesLocal2Repository
  • Have publishPluginMavenPublicationToWebpiecesLocal2Repository depend on project 2 and project 3 publish to local repo tasks

This is a complete guess that MAY work but is this how plugins publish locally to be tested by another project in one single build? (I am assuming this is encountered by someone out there with a more complex plugin that takes in a library in the same repo to do it’s work?)