vet
for better accuracy. In this guide, we’ll use the CycloneDX Gradle plugin to generate a Software Bill of Materials (SBOM) and scan it using vet
.
Why Use Package Manager Integration?
Accurate Resolution
Package managers resolve exact versions and transitive dependencies
Complete Inventory
Capture all dependencies including build-time and runtime components
Standardized Format
Generate industry-standard SBOM formats (CycloneDX, SPDX)
Better Analysis
More accurate security analysis with complete dependency information
Gradle Integration
The CycloneDX Gradle plugin generates comprehensive SBOMs that can be analyzed by vet for security issues.Plugin Configuration
Add the CycloneDX plugin to yourbuild.gradle
file:
Configuration Options
Dependency Scopes
Dependency Scopes
includeConfigs: Which dependency configurations to include
Project Filtering
Project Filtering
skipConfigs and skipProjects: Exclude unnecessary components
Output Customization
Output Customization
destination and outputName: Control where SBOMs are generated
SBOM Generation
Generate SBOM artifacts with a clean build:
build/reports
directory.
Multi-Project Configuration
For multi-module projects, configure the plugin in each module or use a shared configuration:Maven Integration
For Maven projects, use the CycloneDX Maven plugin:Scanning SBOMs with vet
Once you have generated SBOM files, use vet to scan them for security issues:CycloneDX Format
SPDX Format

npm/Node.js Integration
For Node.js projects, use the CycloneDX npm plugin:Python Integration
For Python projects, use cyclonedx-python:CI/CD Integration
Best Practices
Environment-Specific SBOMs
Environment-Specific SBOMs
Generate different SBOMs for different environments:
Regular Updates
Regular Updates
Generate SBOMs regularly to track dependency changes:
- On every build in CI/CD
- Before releases
- After dependency updates
Storage and Versioning
Storage and Versioning
Store SBOMs alongside releases for compliance and audit purposes:
Troubleshooting
Missing Dependencies
Missing Dependencies
If dependencies are missing from the SBOM:
- Check that all relevant configurations are included
- Verify dependency resolution succeeded
- Review skipConfigs and skipProjects settings
Plugin Version Issues
Plugin Version Issues
For plugin compatibility issues:
- Use the latest stable version of CycloneDX plugins
- Check compatibility with your build tool version
- Review plugin documentation for breaking changes
Large SBOM Files
Large SBOM Files
For projects with many dependencies:
- Filter out unnecessary configurations
- Consider splitting large projects into modules
- Use compression for storage and transmission