Publish parent module including child module

That’s a bad idea, that would try to publish the subprojects component under the coordinates of the parent.

Have a convention plugin for publishing where you apply the maven-publish plugin and do the configuration common to both projects. Apply that convention plugin to both projects. Do additional settings unique to the individual projects in the individual projects build scripts.

(Do not try to do it with allprojects { ... } or subprojects { ... }, that would be bad practice and not recommended.

1 Like