🌐
GitHub
github.com › google › google-java-format
GitHub - google/google-java-format: Reformats Java source code to comply with Google Java Style. · GitHub
August 14, 2026 - Reformats Java source code to comply with Google Java Style. - google/google-java-format
Author: google
🌐
GitHub
github.com › google › styleguide › blob › gh-pages › intellij-java-google-style.xml
styleguide/intellij-java-google-style.xml at gh-pages · google/styleguide
Style guides for Google-originated open-source projects - styleguide/intellij-java-google-style.xml at gh-pages · google/styleguide
Author: google
🌐
Google
google.github.io › styleguide › javaguide.html
Google Java Style Guide
This document serves as the complete definition of Google's coding standards for source code in the Java™ Programming Language. A Java source file is described as being in Google Style if and only if it adheres to the rules herein.
🌐
GitHub
github.com › google › styleguide › blob › gh-pages › eclipse-java-google-style.xml
styleguide/eclipse-java-google-style.xml at gh-pages · google/styleguide
Style guides for Google-originated open-source projects - styleguide/eclipse-java-google-style.xml at gh-pages · google/styleguide
Author: google
🌐
GitHub
github.com › topics › google-java-style-guide
google-java-style-guide · GitHub Topics · GitHub
Sample maven module with custom shell script utilizing maven plugins to automate code formatting using Google Java Style guide, and enforcing code coverage, code quality and code security
🌐
GitHub
raw.githubusercontent.com › google › styleguide › gh-pages › intellij-java-google-style.xml
<?xml version="1.0" encoding="UTF-8"?> <code_scheme name="GoogleStyle">
<?xml version="1.0" encoding="UTF-8"?> <code_scheme name="GoogleStyle"> <option name="OTHER_INDENT_OPTIONS"> <value> <option name="INDENT_SIZE" value="2" /> <option name="CONTINUATION_INDENT_SIZE" value="4" /> <option name="TAB_SIZE" value="2" /> <option name="USE_TAB_CHARACTER" value="false" ...
🌐
GitHub
github.com › google › styleguide
GitHub - google/styleguide: Style guides for Google-originated open-source projects · GitHub
Java Style Guide · JSON Style Guide · Markdown Style Guide · Objective-C Style Guide · Python Style Guide · R Style Guide · Shell Style Guide · Swift Style Guide · TypeScript Style Guide · Vim script Style Guide · This project also contains google-c-style.el, an Emacs settings file for Google style.
Author: google
🌐
Google
google.github.io › styleguide › intellij-java-google-style.xml
intellij-java-google-style.xml
xmlns:android · xmlns:.* · BY_NAME · *:id · http://schemas.android.com/apk/res/android · style · *:.*Style
🌐
GitHub
github.com › google › styleguide › blob › gh-pages › javaguide.html
styleguide/javaguide.html at gh-pages · google/styleguide
<p>This document serves as the <strong>complete</strong> definition of Google's coding standards for · source code in the Java™ Programming Language.
Author: google
Find elsewhere
🌐
GitHub
github.com › google › google-java-format › releases
Releases · google/google-java-format
Reformats Java source code to comply with Google Java Style. - Releases · google/google-java-format
Author: google
🌐
Google
google.github.io › styleguide
Google Style Guides | Style guides for Google-originated open-source projects
With few exceptions, these style guides are copies of Google’s internal style guides to assist developers working on Google owned and originated open source projects. Changes to the style guides are made to the internal style guides first and eventually copied into the versions found here. External contributions are not accepted. Pull requests are regularly closed without comment. People can file issues using the GitHub tracker.
Author: frellan
Starred by 119 users
Forked by 30 users
Languages: TypeScript 99.6% | JavaScript 0.4%
🌐
GitHub
github.com › justinludwig › gjfpc-hook
GitHub - justinludwig/gjfpc-hook: Git pre-commit script for the Google Java Style Guide, using the Google Java Format library · GitHub
A git pre-commit script that formats java code according to the Google Java Style Guide, using the Google Java Format library.
Starred by 18 users
Forked by 9 users
Languages: Shell
🌐
GitHub
github.com › google › styleguide › issues › 687
eclipse-java-google-style.xml and intellij-java-google-style.xml are obsolete and should be removed · Issue #687 · google/styleguide
April 25, 2022 - Both eclipse-java-google-style.xml and intellij-java-google-style.xml were last updated 4 years ago and are effectively obsolete. Google has moved its focus to google-java-format because “Eclipse a...
Author: google
Starred by 59 users
Forked by 71 users
Languages: Shell 100.0% | Shell 100.0%
🌐
GitHub
github.com › google › google-java-format › wiki › FAQ
FAQ · google/google-java-format Wiki · GitHub
Reformats Java source code to comply with Google Java Style. - google/google-java-format
Author: google
Top answer
1 of 1
3

You need to include a maven plugin that supports Googles Java format. It seems like your goal verifyGoogleJavaFormat is available for Gradle, but not for Maven. One option is to use https://github.com/Cosium/git-code-format-maven-plugin. It supports format verification and automatic formatting upon comitting.

The Github Repo documentation states that you can include it in your pom.xml like this:

<build>
    <plugins>
        <plugin>
            <groupId>com.cosium.code</groupId>
            <artifactId>git-code-format-maven-plugin</artifactId>
            <version>3.3</version>
            <executions>
                <!-- On commit, format the modified java files -->
                <execution>
                    <id>install-formatter-hook</id>
                    <goals>
                        <goal>install-hooks</goal>
                    </goals>
                </execution>
                <!-- On Maven verify phase, fail if any file
                (including unmodified) is badly formatted -->
                <execution>
                    <id>validate-code-format</id>
                    <goals>
                        <goal>validate-code-format</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Now, when I run mvn verify on my unformatted project I get an error:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.090 s
[INFO] Finished at: 2022-03-12T17:56:13+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.cosium.code:git-code-format-maven-plugin:3.3:validate-code-format (validate-code-format) on project javatest: /home/bisensee/repos/javatest/src/main/java/Position.java is not correctly formatted ! -> [Help 1] 

When we make our next commit the formatter is automatically applied via a Git hook and the next mvn verify succeeds.