googleformatter-maven-plugin Maven Mojo

Apache Maven Mojo for reformatting code using the Google Code Formatter

License

License

Apache License, Version 2.0
Categories

Categories

Maven Build Tools ORM Data
GroupId

GroupId

com.theoryinpractise
ArtifactId

ArtifactId

googleformatter-maven-plugin
Last Version

Last Version

1.7.5
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

googleformatter-maven-plugin Maven Mojo
Apache Maven Mojo for reformatting code using the Google Code Formatter
Project URL

Project URL

http://maven.apache.org
Source Code Management

Source Code Management

https://github.com/talios/googleformatter-maven-plugin

Download googleformatter-maven-plugin

How to add to project

<plugin>
    <groupId>com.theoryinpractise</groupId>
    <artifactId>googleformatter-maven-plugin</artifactId>
    <version>1.7.5</version>
</plugin>

Dependencies

compile (13)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0
org.codehaus.plexus : plexus-utils jar 3.2.0
org.apache.maven : maven-plugin-api jar 3.6.1
org.apache.maven : maven-core jar 3.6.1
org.codehaus.plexus : plexus-compiler-api jar 2.8.5
org.apache.maven.scm : maven-scm-api jar 1.11.2
org.apache.maven.scm : maven-scm-manager-plexus jar 1.11.2
org.apache.maven.scm : maven-scm-providers-standard pom 1.11.2
com.google.guava : guava jar 28.0-jre
com.google.truth : truth jar 0.45
com.google.googlejavaformat : google-java-format jar 1.7
com.google.errorprone : error_prone_annotations jar 2.3.3
org.mockito : mockito-core jar 2.28.2

Project Modules

There are no modules declared in this project.

Google Formatter Plugin for Apache Maven

A simple Apache Maven plugin to reformat a projects source/test-sources using the google-java-format project to conform with the Google Code Style Guide.

By default the plugin will only process stale source files ( comparing against their respective .class files existence/timestamp ).

After processing each file, the contents sha1 is compared against the original and only rewritten if they no longer match.

    <plugin>
      <groupId>com.theoryinpractise</groupId>
      <artifactId>googleformatter-maven-plugin</artifactId>
      <version>1.7.3</version>
      <executions>
        <execution>
          <id>reformat-sources</id>
          <configuration>
            <includeStale>false</includeStale>
            <style>GOOGLE</style>
            <formatMain>true</formatMain>
            <formatTest>true</formatTest>
            <filterModified>false</filterModified>
            <skip>false</skip>
            <fixImports>false</fixImports>
            <maxLineLength>100</maxLineLength>
          </configuration>
          <goals>
            <goal>format</goal>
          </goals>
          <phase>process-sources</phase>
        </execution>
      </executions>
    </plugin>

Changes

  • 1.7.4 - Wed 19 Jun 2019 23:52:15 NZST
    • Add formatMain / formatTest options*
  • 1.7.3 -Tue 4 Jun 2019 12:31:34 NZST
    • Restored maxLineLenght and formatter.maxLineLength property
  • 1.0.6 - Tue 31 May 2016 10:51:16 NZST
    • Exposed formatter.modified to reformat only changed SCM files.
    • Requires Java 8 to run now.
  • 1.0.5 - Thu 26 May 2016 11:35:33 NZST
    • Exposed formatter.length as a property
  • 1.0.4 - Fri 15 Apr 2016 22:13:39 NZST
    • Dropped required flag on configuration values.
  • 1.0.3 - Fri 15 Apr 2016 20:45:58 NZST
    • Added <skip> ( and -Dformatter.skip ) configuration setting to skip reformatting code.
  • 1.0.2 - Thu 14 Apr 2016 12:58:00 NZST
    • Handle missing test directories.

Versions

Version
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.6.5
1.6.4
1.6.3
1.6.2
1.6.1
1.5.1
1.4.1
1.3.1
1.2.1
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0