Maven-publish plugin does not apply tasks to projects in multi-project that are project dependencies of another project


I have a custom plugin that applies “maven” and “maven-publish” to the project and also configures a publication for a the project.

I applied this plugin to serveral projects in a multi project. For some reason it looks like the the “maven-publish” tasks like “generatePomFileForXXXXPublication” are not applied to tasks that are referenced by other projects.

dependencies {
 myConf project(":pro1")

pro1 does not have the maven publish specific tasks.

I did some debugging and the maven-publish plugin gets applied to every project but it looks like

org.gradle.api.publish.maven.internal.MavenPublishTaskModelRule.realizePublishingTasks(TaskContainer, PublishingExtension)

method is only called on the projects that are not referenced as a project depedendency.

A further problem I have which I think is cause by this problem that in the projects where the pom generating works the project dependencies do not have group and version I specified in these projects but only the parent dir name as group and as version unspecific

I tried to make a sample plugin to show case the problem but “unfortunately” it seems to work there, so my best guess is that my plugin somehow confuses the evaluation but I have no idea why.

Any idea what the problem could be?

Thanks in advance