I have added mavenCentral() in rootProject build script. But its giving below error while build. Any idea on this.
You probably need to add a repository containing the '[com.google.googlejavaformat:google-java-format:1.5]' artifact in the 'build.gradle' of your root project.
E.g.: 'buildscript { repositories { mavenCentral() }}'
Note that included buildscripts (using 'apply from') do not share their buildscript repositories with the underlying project.
You have to specify the missing repository explicitly in the buildscript of the root project.
Do you have jcenter() as a repository in your build.gradle(project)?
There is already exist Google Java Format in JCenter