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
- 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
- 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)
- Gradle: Java 21
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
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.