The publishMavenJavaPublicationToMavenLocal task disappears from a project when that project is depended upon in a specific way.

Assume structure

  root  root gradle build file  ->A

 own gradle build file  -> shared



gradle build file for shared modules



 -> shared:domain



 -> shared:B  
The publishMavenJavaPublicationToMavenLocal task is available on domain when the maven-publishing plugin has been defined using "from components.java" and there are no dependencies between projects.

If A defines its own build.gradle file and has a project dependency on domain then domain will no longer have the publishMavenJavaPublicationToMavenLocal task available.

If B has a project dependency on domain and A does not then the publishMavenJavaPublicationToMavenLocal task is still available.

Dependencies upon a module should not affect its publishability.

The minimal example project demonstrating this is available on github - https://github.com/piersy/Gradle2MavenPublishBug Thanks

Piers

Guys any update on this? it’s a real blocker, it basically renders gradle unusable for multimodule builds using a local maven repo! I also noticed that it’s not isolated, I think the same problem is occurring here - http://stackoverflow.com/questions/26577614/gradles-publishtomavenlocal-task-is-not-executed-correctly