GitHub
github.com › sherter › google-java-format-gradle-plugin
GitHub - sherter/google-java-format-gradle-plugin · GitHub
A Gradle plugin that utilizes google-java-format to format the Java source files in your Gradle project.
Author: sherter
GitHub
github.com › sherter › google-java-format-gradle-plugin › blob › master › README.adoc
google-java-format-gradle-plugin/README.adoc at master · sherter/google-java-format-gradle-plugin
A Gradle plugin that utilizes google-java-format to format the Java source files in your Gradle project.
Author: sherter
Maven Repository
mvnrepository.com › artifact › gradle.plugin.com.github.sherter.google-java-format › google-java-format-gradle-plugin
Maven Repository: gradle.plugin.com.github.sherter.google-java-format » google-java-format-gradle-plugin
Home » gradle.plugin.com.github.sherter.google-java-format » google-java-format-gradle-plugin · Google Java Format Gradle Plugin · Gradle Plugins (11) Central · Atlassian External · Atlassian · WSO2 Releases · WSO2 Public · Hortonworks · Mulesoft · JCenter ·
GitHub
github.com › sherter › google-java-format-gradle-plugin › blob › master › build.gradle
google-java-format-gradle-plugin/build.gradle at master · sherter/google-java-format-gradle-plugin
relocate('com.google.common', 'com.github.sherter.googlejavaformatgradleplugin.com.google.common')
Author: sherter
Maven Repository
mvnrepository.com › artifact › com.github.sherter.google-java-format
Maven Repository: com.github.sherter.google-java-format
GitHub Sherter Google Java Format · Links · Artifact1 · Jenkins Public1 · Gradle Plugins1 · Home » com.github.sherter » google-java-format · com.github.sherter.google-java-format » com.github.sherter.google-java-format.gradle.plugin · GitHub Sherter Google Java Format Gradle Plugin ·
Top answer 1 of 2
1
Sherter gradle plugin is automatically integrated to "gradle build". When you run it, it will run "gradle verifyGoogleJavaFormat". In case of violations, the build will fail.
We are using it on jenkins and it works. You will only need dependency to build.gradle file:
compile group: 'com.github.sherter.google-java-format', name: 'com.github.sherter.google-java-format.gradle.plugin', version: '0.8', ext: 'pom'
And also add plugin:
id 'com.github.sherter.google-java-format' version '0.8'
Then just run "gradle build" and you can see in the console, that verifyGoogleJavaFormat was executed.
2 of 2
0
DependsOn plugin's task that you need from a task that relates to a normal build, for example, you can use preBuild task:
tasks.findByName("preBuild").dependsOn(YOUR_TASK_FROM_PLUGIN)
or shorter
preBuild.dependsOn(YOUR_TASK_FROM_PLUGIN)
Also you can choose another task instead of preBuild.
Oreate AI
oreateai.com › blog › taming-your-code-a-gradle-plugin-for-pristine-java-formatting › 1d3b8cee7f1936d8ac6a21165d43b97f
Taming Your Code: A Gradle Plugin for Pristine Java Formatting - Oreate AI Blog
February 17, 2026 - But integrating such a tool into your build process can sometimes feel like another hurdle. Fortunately, the sherter/google-java-format-gradle-plugin on GitHub offers a neat solution, making it surprisingly straightforward to bake this powerful formatter right into your Gradle projects.
GitHub
github.com › sherter › google-java-format-gradle-plugin › blob › master › contrib › pre-commit
google-java-format-gradle-plugin/contrib/pre-commit at master · sherter/google-java-format-gradle-plugin
December 13, 2017 - Contribute to sherter/google-java-format-gradle-plugin development by creating an account on GitHub.
Author: sherter
GitHub
github.com › sherter › google-java-format-gradle-plugin › issues
Issues · sherter/google-java-format-gradle-plugin
June 22, 2024 - Contribute to sherter/google-java-format-gradle-plugin development by creating an account on GitHub.
Author: sherter
Gradle
plugins.gradle.org › search
google-java-format
Spotless - keep your code spotless with Gradle · Format your Java source files with google-java-format
GitHub
github.com › sherter › google-java-format-gradle-plugin › issues › 46
Plugin fails with google-java-format 1.8 · Issue #46 · sherter/google-java-format-gradle-plugin
May 4, 2020 - When using this plugin with version 1.8 of google-java-format, the execution fails. build.gradle: plugins { id 'java' id 'com.github.sherter.google-java-format' version '0.8' } googleJavaFormat { toolVersion = '1.8' } Gradle output: * What went wrong: Execution failed for task ':googleJavaFormat'.
Author: sherter