Q:

Gradle Multiproject Build pushToLocalMaven before

I have a gradle project consist of multiple java projects. Let's say we have two projects, ProjectA and ProjectB. I would like to send ProjectA jar to local maven repo, before ProjectB starts to compile. Because ProjectB depends on ProjectA. I know I can do this from command line with gradle clean build pTML or gradle publishToMavenLocal command separately. But, I want to do this in main build.gradle without any extra steps in one shot.  
RootProject
├── ProjectA
│   ├── build.gradle
│   └── src
└── ProjectB
    ├── build.gradle
    └── src

A:

I've solved the problem by adding build.finalizedBy(publishToMavenLocal) command to all the subprojects. By this way after a project is build, it is directly published to maven local repository. @Vampire thank you for your help, I think also solves the problem but this seems the easier way.

