Universal build configuration and quality standards for all FlossWare projects.
Supported Languages: Java (Maven), Shell/Bash, C/C++, Go, Python
Maven Artifact: org.flossware:jbuild-tools (unchanged for backward compatibility)
Repository: https://github.com/FlossWare/build-tools
- Checkstyle - Code style and formatting rules
- ✓ NO wildcard imports
- ✓ Final parameters required (NOT local variables)
- ✓ Naming conventions, whitespace, braces
- PMD - Code quality and best practices
- ✓ Detects unnecessary temporary variables
- ✓ Enforces method chaining preference
- SpotBugs - Bug detection and security checks
- JaCoCo - 100% test coverage enforcement
- ✓ Instruction coverage
- ✓ Branch coverage
- ✓ Line coverage
- ✓ Class coverage
- EditorConfig - IDE formatting settings
- Version Enforcement - Enforces X.Y version format (no X.Y.Z)
- PackageCloud Publishing - Ready for packagecloud.io deployment
- Mockito Fix - Eliminates JDK agent warnings
- IDE Support - IntelliJ, Eclipse, NetBeans, VS Code
Automatically monitor code quality and create GitHub issues when checks fail:
# Distribute quality gate workflow to all projects
cd build-tools
./distribute-quality-workflow.sh --all
# Then commit in each project
cd ../jcommons
git add .github/
git commit -m "Add automated quality gate workflow"
git pushWhat gets automated:
- ✅ Auto-creates GitHub issues for:
- Code coverage drops
- SpotBugs violations
- PMD violations
- Checkstyle errors
- Security vulnerabilities (OWASP)
- ✅ PR comments with quality metrics
- ✅ Daily security scans
- ✅ Prevents merging failing PRs
See AUTOMATED-QUALITY-MONITORING.md for complete guide.
Automatically converts your code to FlossWare standards:
# Auto-refactor a project (inline variables, fix imports, format code)
cd build-tools
./auto-refactor.sh ../jcommons
# Preview changes first
./auto-refactor.sh --dry-run ../jcommons
# Refactor all projects
./auto-refactor.sh --allWhat gets automated:
- ✅ Inline single-use variables → method chaining
- ✅ Remove wildcard imports
- ✅ Add missing @Override annotations
- ✅ Format code consistently
- ✅ Remove unused code
See AUTOMATED-REFACTORING.md for details.
# Apply FlossWare build configuration to projects
./rollout-standards.sh --all
# Or apply to specific project
./rollout-standards.sh --project ../jcommons
# Preview changes first (dry run)
./rollout-standards.sh --all --dry-runSee ROLLOUT-GUIDE.md for complete instructions.
From this directory, run:
mvn clean installThis publishes the configuration files to your local Maven repository.
Add these plugins to your project's pom.xml:
<build>
<plugins>
<!-- Checkstyle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.1</version>
<dependencies>
<dependency>
<groupId>org.flossware</groupId>
<artifactId>build-tools</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.12.5</version>
</dependency>
</dependencies>
<configuration>
<configLocation>flossware-checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<violationSeverity>warning</violationSeverity>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- PMD -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.21.2</version>
<dependencies>
<dependency>
<groupId>org.flossware</groupId>
<artifactId>build-tools</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<configuration>
<rulesets>
<ruleset>flossware-pmd-ruleset.xml</ruleset>
</rulesets>
<printFailingErrors>true</printFailingErrors>
<failOnViolation>true</failOnViolation>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- SpotBugs -->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.2.0</version>
<dependencies>
<dependency>
<groupId>org.flossware</groupId>
<artifactId>build-tools</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<configuration>
<excludeFilterFile>flossware-spotbugs-exclude.xml</excludeFilterFile>
<effort>Max</effort>
<threshold>Low</threshold>
<failOnError>true</failOnError>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>Copy the .editorconfig file to the root of each project:
cp build-tools/.editorconfig /path/to/your-project/mvn clean verifymvn checkstyle:check
mvn pmd:check
mvn spotbugs:checkmvn checkstyle:checkstyle
mvn pmd:pmd
mvn spotbugs:spotbugsReports are generated in target/site/.
If a project needs different rules, you can:
- Override specific rules in the project's POM
- Create a local config file that supplements the shared one
- Adjust severity levels (
failOnViolation,violationSeverity)
<configuration>
<failOnViolation>false</failOnViolation>
</configuration>- Edit the configuration files in
src/main/resources/ - Increment the version in
pom.xml - Run
mvn clean install - Update the version in dependent projects
All FlossWare projects use X.Y versioning (e.g., 1.0, 2.5), NOT X.Y.Z.
The enforcer plugin will fail your build if you use the wrong format:
# ✓ Valid versions
1.0
2.5
10.3
# ✗ Invalid versions
1.0.0
2.5.1
1.0-SNAPSHOT # For snapshots, use in distributionManagement insteadCheckstyle enforces explicit imports. This will fail:
import java.util.*; // ✗ FAILSUse specific imports:
import java.util.List; // ✓ PASSES
import java.util.ArrayList; // ✓ PASSESAll method parameters must be final:
// ✗ FAILS - Missing final
public void process(String input) {
// ...
}
// ✓ PASSES - Parameters are final
public void process(final String input) {
// ...
}Prefer chaining methods over single-use temporary variables:
// ✓ PREFERRED - Method chaining
public String normalize(final String input) {
return input.trim()
.toLowerCase()
.replaceAll("\\s+", " ");
}
// ✗ AVOID - Unnecessary temporaries
public String normalize(final String input) {
final String trimmed = input.trim();
final String lower = trimmed.toLowerCase();
return lower.replaceAll("\\s+", " ");
}See METHOD-CHAINING.md for complete style guide.
JaCoCo enforces 100% test coverage on all metrics:
mvn clean verify # Fails if coverage < 100%Coverage report: target/site/jacoco/index.html
Metrics checked:
- Instruction coverage: 100%
- Branch coverage: 100%
- Line coverage: 100%
- Class coverage: 0 missed
See TEST-COVERAGE.md for:
- How to achieve 100% coverage
- Common testing patterns
- Gradual adoption strategies
- IDE integration
Problem: "This will no longer work in future releases of the JDK. Please add Mockito as an agent..."
Solution: Use mockito-inline instead of mockito-core:
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>Bulk Fix Across All Projects:
./build-tools/fix-mockito-warning.shSee MOCKITO-FIX.md for detailed instructions and alternatives.
Use the provided script to increment versions:
# Bump minor version (1.0 -> 1.1)
./build-tools/bump-version.sh minor path/to/project
# Bump major version (1.5 -> 2.0)
./build-tools/bump-version.sh major path/to/project
# From within a project directory
cd jcommons
../build-tools/bump-version.sh minorThe script automatically:
- Validates current version format
- Updates
pom.xml - Provides next-step instructions
All FlossWare projects should include relevant GitHub topics for discoverability:
# Set topics using GitHub CLI
gh repo edit --add-topic java,maven,junit,code-coverage,jacoco
# Common topics by project type:
# - Core: java, maven, junit, code-coverage, jacoco
# - Java version: java11, java17, java21
# - Functionality: threadpool, event-bus, encryption, cloud-storage, etc.Why topics matter:
- Improves repository discoverability
- Helps developers find relevant projects
- Categorizes projects by technology stack
- Enables GitHub's topic-based search
Standard topics for all FlossWare Java projects:
java- Programming languagemaven- Build tooljunit- Testing frameworkcode-coverage- Coverage enforcementjacoco- Coverage tool
Java version (pick one):
java11- For Java 11 projectsjava17- For Java 17 projectsjava21- For Java 21+ projects
Add project-specific topics based on functionality (e.g., threadpool, collections, security).
FlossWare projects are configured to publish to PackageCloud.io.
See PACKAGECLOUD-SETUP.md for detailed instructions.
Quick setup:
# Add to ~/.m2/settings.xml
<server>
<id>packagecloud-flossware</id>
<password>YOUR_PACKAGECLOUD_API_TOKEN</password>
</server># Deploy to PackageCloud
mvn clean deployFlossWare standards work with all major Java IDEs:
- IntelliJ IDEA - Full support with auto-fix
- Eclipse - Full support with save actions
- NetBeans - Full support with hints and quick fix - See NETBEANS-SETUP.md
- VS Code - Full support with Java extensions
Each IDE can auto-add final modifiers, format code, and show coverage inline.
flossware-checkstyle.xml- Style rules (naming, formatting, NO wildcards, final enforcement)flossware-pmd-ruleset.xml- Code quality rulesflossware-spotbugs-exclude.xml- Bug patterns to ignore.editorconfig- IDE formatting preferences
flossware-project-template.xml- Complete project template with all standards (includes JaCoCo)example-project-pom-snippet.xml- Quick copy-paste snippet (strict 100% coverage)jacoco-pragmatic-snippet.xml- ⭐ NEW: JaCoCo with sensible exclusions (pragmatic 100%)jacoco-pragmatic-excludes.xml- ⭐ NEW: Reference list of standard exclusions
bump-version.sh- Version increment scriptdistribute-editorconfig.sh- Copy .editorconfig to all projectsfix-mockito-warning.sh- Bulk fix Mockito agent warningsrollout-standards.sh- Apply standards to projects (supports--pragmatic-coverage)auto-refactor.sh- Automated code refactoringverify-all-projects.sh- Check compliance across all projectscreate-new-project.sh- Generate new projects with standards
mockito-agent-config.xml- Mockito agent configuration options
README.md- This file, complete usage guideQUICK-START.md- Quick referenceCHANGELOG.md- Version historyAUTOMATED-REFACTORING.md- ⭐ Automated code transformations (NEW!)COVERAGE-RECOMMENDATIONS.md- ⭐ Project-specific coverage guidelines (NEW!)ROLLOUT-GUIDE.md- Organization rollout guideMETHOD-CHAINING.md- Method chaining style guide (prefer chaining over temporaries)FINAL-VARIABLES.md- Final parameters standard (parameters only, not locals)TEST-COVERAGE.md- 100% coverage guide and best practicesNETBEANS-SETUP.md- NetBeans IDE configurationMOCKITO-FIX.md- Fix Mockito JDK agent warningsPACKAGECLOUD-SETUP.md- Publishing to PackageCloud.io
We welcome contributions to FlossWare Build Tools! Whether you're reporting bugs, suggesting features, or submitting code improvements, your input helps make this project better for everyone.
- Report Issues - Found a bug or have a feature request? Open an issue on GitHub
- Submit Pull Requests - Fork the repository, make your changes, and submit a PR
- Improve Documentation - Help clarify setup guides, add examples, or fix typos
- Share Feedback - Let us know how you're using these tools in your projects
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold this code. Please report unacceptable behavior to scot.floess@gmail.com.
- Follow the same FlossWare standards that this project enforces
- Add tests for new functionality
- Update documentation for user-facing changes
- Run
mvn clean verifybefore submitting PRs
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
What this means:
- ✓ You can freely use, modify, and distribute this software
- ✓ You can use it in commercial projects
- ✓ Any modifications must also be licensed under GPL v3.0
- ✓ You must include the license and copyright notice
For more information, visit https://www.gnu.org/licenses/gpl-3.0.html