Welcome to the CycloneDX Gradle Plugin project! We appreciate your interest in contributing to this open source project. This guide will help you get started with setting up your development environment and understanding our contribution process.
- Getting Started
- Development Environment Setup
- Working with Gradle Toolchains
- Code Style and Formatting
- Building and Testing
- Publishing Plugin Locally
- Submitting Contributions
- Releasing
- Community Guidelines
The CycloneDX Gradle Plugin creates Software Bill of Materials (SBOM) from Gradle projects, supporting the CycloneDX specification. All open issues are welcome to contributors, and we value contributions of all sizes - from bug reports and documentation improvements to new features.
Before contributing, please:
- Read through this contributing guide
- Review the project's domain language and architecture decisions before changing public concepts or architectural boundaries
- Check our Code of Conduct
- Browse existing issues to see if your idea or bug has already been reported
- Java Development Kit (JDK): Java 8 or higher
- Git: For version control
- IDE: IntelliJ IDEA, Eclipse, or VS Code with Java support
git clone https://github.com/CycloneDX/cyclonedx-gradle-plugin.git
cd cyclonedx-gradle-pluginThis project uses Gradle toolchains to ensure compatibility across different Java versions. The build is configured to:
- Target Java Version: Java 8 (for maximum compatibility)
- Testing: Multiple LTS Java versions (8, 11, 17, 21, 25)
- Gradle: Java 25
Tests are automatically run against multiple Java versions:
# Run tests with all supported Java versions
./gradlew test
# Run tests with a specific Java version
./gradlew testJava8
./gradlew testJava11
./gradlew testJava17
./gradlew testJava21If you need to specify custom Java installations, you can configure toolchains in your global gradle.properties file (
~/.gradle/gradle.properties):
# Define custom Java installation paths
org.gradle.java.installations.paths=/path/to/jdk8,/path/to/jdk11,/path/to/jdk17,/path/to/jdk21
# Disable automatic detection if needed
org.gradle.java.installations.auto-detect=falseThis project uses the Spotless plugin with PalantirJavaFormat for consistent code formatting.
- Formatter: PalantirJavaFormat
- Line Length: 120 characters
- Indentation: 4 spaces
- License Header: Required on all Java files
This project uses Spotless plugin that will:
- Check code formatting during build
- Apply automatic license headers
- Format code according to PalantirJavaFormat standards
# Check for formatting violations
./gradlew spotlessCheck
# Apply formatting fixes automatically
./gradlew spotlessApplyFor detailed information about the PalantirJavaFormat style, see:
- Official Documentation: PalantirJavaFormat on GitHub
- Spotless: palantir-java-format Gradle Plugin
# Clean and build the project
./gradlew clean build# Run all tests
./gradlew test
# Run tests with specific Java version
./gradlew testJava11
# Run tests with verbose output
./gradlew test --infoThe project uses GitHub Actions for CI/CD. All pull requests must:
- Pass all tests on multiple Java versions (8, 11, 17, 21)
- Pass Spotless formatting checks
- Build successfully
- Every commit must be signed off with
git commit -sto acknowledge the Developer Certificate of Origin (DCO)
To test your changes with other projects, you can publish the plugin to your local Maven repository:
-
Build and publish locally:
./gradlew publishToMavenLocal
-
Configure your test project to use the local plugin by adding to
settings.gradleorsettings.gradle.kts:pluginManagement { repositories { mavenLocal() // This must be first for priority gradlePluginPortal() mavenCentral() } } -
Use the plugin in your test project's
build.gradle:plugins { id 'org.cyclonedx.bom' version '<version>' }
After publishing locally, you can verify the installation:
# Check local Maven repository
ls ~/.m2/repository/org/cyclonedx/cyclonedx-gradle-plugin/- Fork the repository
- Create a branch for your feature or fix:
git checkout -b feature/my-new-feature
- Make your changes following the coding standards
- Run tests and formatting:
./gradlew spotlessApply ./gradlew test - Commit your changes with a clear message:
git commit -s -m "feat: add support for new SBOM feature" - Push to your fork and create a pull request
- Clear Description: Explain what changes you made and why
- Tests: Include tests for new functionality
- Documentation: Update documentation for new features
- Small Changes: Keep PRs focused and manageable
- Code Quality: Ensure all checks pass (formatting, tests, build)
We follow conventional commit format:
feat:for new featuresfix:for bug fixesdocs:for documentation changesstyle:for formatting changesrefactor:for code refactoringtest:for adding testschore:for maintenance tasks
Publishing a GitHub Release is the maintainer's release authorization. The Publish CI workflow validates and builds
the tagged commit, generates and verifies its attestations, uploads the release SBOM, and publishes the plugin to the
Gradle Plugin Portal.
- Update the project version in
build.gradle.ktsand the literal plugin versions in the README examples. Keep the release-SBOM bootstrap plugin on the latest already-published version until after the release, and keep intentional compatibility fixtures pinned to the releases they test. - Merge the release-preparation change and wait for Build CI to pass on
master. - Before the first release after changing
Publish CI, open Actions > Publish CI, select Run workflow, choosemaster, and run it manually. - Confirm that the rehearsal succeeds for the intended version and commit. Its summary records the source ref and SHA-256 digest of every release artifact; the same artifacts are also available as a workflow-run download.
A manual Publish CI run uses a read-only build job and cannot execute the release-only jobs or steps that upload or
publish a release. Gradle Plugin Portal secrets are referenced only by the production step. Rehearsal attestations
describe the selected branch commit; the production run creates new attestations for the immutable release tag.
- Open Releases > Draft a new release on GitHub.
- Create
cyclonedx-gradle-plugin-<version>at the exactmastercommit that passed the required checks and any rehearsal, then prepare the release notes. - Publish the release as the latest release. This starts
Publish CI; no separate manual publication command or approval is required. - Confirm that
Publish CIsucceeds, the release contains its versioned CycloneDX SBOM, and the new version is available from the Gradle Plugin Portal. - In a follow-up change, advance the release-SBOM bootstrap plugin and its release-artifact expectation to the newly published version.
All open issues are welcome to contributors! Whether you're a beginner or experienced developer, there are issues suitable for all skill levels. Look for:
- Good First Issue: Great for newcomers
- Help Wanted: Issues that need community assistance
- Bug: Issues requiring fixes
- Enhancement: Feature requests and improvements
If you need help with:
- Development Questions: Open a discussion or comment on relevant issues
- CycloneDX Specification: Visit CycloneDX.org
- Community Support: Join the CycloneDX Slack
- All contributions require review from project maintainers
- Feedback will be provided constructively and promptly
- Address review comments and update your PR
- Once approved, maintainers will merge your contribution
We value all contributions and recognize contributors through:
- Attribution in release notes
- Contributor acknowledgments
- Community recognition
- Project Website: CycloneDX.org
- CycloneDX Specification: CycloneDX Documentation
- Issue Tracker: GitHub Issues
- Discussions: GitHub Discussions
Thank you for contributing to CycloneDX Gradle Plugin! Your efforts help improve software supply chain security for the entire community.