Java code formatter and Maven plugin for Airlift code style.
The formatter produces output according to the formatter style, which starts from the Airlift.xml IntelliJ code style configuration and extends it with additional rules, including wrapping, imports, comments, Javadoc, and Checkstyle compatibility.
The Airstyle plugin has two goals:
checkverifies that Java sources are properly formatted, and fails the build if any files need formatting.formatrewrites Java sources in place to be properly formatted.
Add the plugin to your build to run check in the default validate phase:
<build>
<plugins>
<plugin>
<groupId>io.airlift</groupId>
<artifactId>airstyle-maven-plugin</artifactId>
<version><!-- current plugin version --></version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>After configuring the plugin, run your normal build to execute check:
mvn validateRewrite source files with the configured plugin:
mvn airstyle:formatIf you just want to try the plugin without configuring it, you can run the goals directly:
mvn io.airlift:airstyle-maven-plugin:RELEASE:check
mvn io.airlift:airstyle-maven-plugin:RELEASE:formatThese parameters are shared by check and format:
| Parameter | Description |
|---|---|
<sourceDirectories> |
Source directories to process. Default: compile source roots User Property: airstyle.sourceDirectories |
<testSourceDirectories> |
Test source directories to process. Default: test compile source roots User Property: airstyle.testSourceDirectories |
<includes> |
Ant-style patterns for included files. Default: **/*.javaUser Property: airstyle.includes |
<excludes> |
Ant-style patterns for excluded files. Default: no exclusions User Property: airstyle.excludes |
<includeTestSources> |
Include test source roots. Default: trueUser Property: airstyle.includeTestSources |
<parallel> |
Process files in parallel. Default: trueUser Property: airstyle.parallel |
<skip> |
Skip goal execution. Default: falseUser Property: airstyle.skip |
<rewriteUnusedLambdaParameters> |
Rewrite unused lambda parameters to Java's unnamed variable _. Set to false for Java 21 and older projects.Default: trueUser Property: airstyle.rewriteUnusedLambdaParameters |
| Parameter | Description |
|---|---|
<failOnViolation> |
Fail the build when files needing formatting are found. Default: trueUser Property: airstyle.failOnViolation |
See LICENSE. Airstyle is licensed under the Apache License 2.0.