See also: Building
The build is configured with four code-quality tools that run automatically in CI:
| Tool | What It Checks |
|---|---|
| CheckStyle | Code style and naming conventions |
| SpotBugs | Potential bugs via static analysis |
| Revapi | Breaking API changes against the latest GA release |
| JaCoCo | Test coverage thresholds |
All four are configured to fail the build on violations.
Always run them locally before opening a pull request.
mvn spotbugs:check checkstyle:checkstyle-aggregate \
-DskipTests -Dgpg.skip \
-pl "<groupId>:<artifactId>" -amExample for azure-core:
mvn spotbugs:check checkstyle:checkstyle-aggregate \
-DskipTests -Dgpg.skip \
-pl "com.azure:azure-core" -ammvn revapi:checkThis compares the current API surface against the latest GA version on Maven Central and reports any incompatible changes.
mvn install site:site site:stage -Dgpg.skipReport output locations:
| Report | Path |
|---|---|
| SpotBugs | eng/spotbugs-aggregate-report/target/spotbugs/spotbugsXml.html |
| CheckStyle | target/staging/checkstyle-aggregate.html |
| JavaDoc | target/staging/apidocs/index.html |
| Revapi | target/staging/revapi-aggregate-report.html |
| Maven Site | target/staging/index.html |
mvn test -Dgpg.skip -Dinclude-non-shipping-modulesReport: eng/jacoco-test-coverage/target/site/test-coverage/index.html
Add these flags to any Maven command for a faster local build:
-Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true
Do not skip these in your final PR build. CI will check them regardless.
The linting configuration files live under eng/lintingconfigs/:
| File | Purpose |
|---|---|
eng/lintingconfigs/checkstyle/track2/checkstyle.xml |
CheckStyle rules |
eng/lintingconfigs/checkstyle/track2/checkstyle-suppressions.xml |
Per-module suppressions |
eng/lintingconfigs/spotbugs/spotbugs-exclude.xml |
SpotBugs exclusion filters |
If a package has a legitimately long name (approved by architects), add a suppression:
<!-- eng/lintingconfigs/checkstyle/track2/checkstyle-suppressions.xml -->
<suppress checks="PackageName" files="com/azure/resourcemanager/<verylongsegment>/.*\.java"/>Important: Never disable CheckStyle or SpotBugs rules globally.
File-scoped suppressions require justification in the PR description.