Skip to content

Conversation

behnazh-w
Copy link
Member

@behnazh-w behnazh-w commented Aug 8, 2025

Summary

This PR removes the automatic SBOM generation feature for Java projects in Macaron.

Description of changes

The automatic SBOM generation functionality for Java (via Maven and Gradle) has been removed from Macaron. This decision was made for the following reasons:

  • Avoid executing build tools: Running Maven or Gradle executables within Macaron can pose security and consistency risks.
  • Build environment separation: Generating SBOMs outside of the actual build environment may produce incomplete or inaccurate results.
  • Performance concerns: SBOM generation can be time-consuming, which negatively impacts the analysis time when done automatically within Macaron.

As part of this refactor:

  • The SBOM generation logic for Java has been fully removed.
  • Corresponding unit tests have been deleted or updated to reflect the removal of this feature.
  • Documentation has been updated to no longer reference automatic SBOM generation for Java.
  • cyclonedx-bom and cyclonedx-python-lib[validation] dependencies have been updated.
  • The $HOME/.m2 directory in the container is empty and no longer mounted or used by the Python package.
  • Update the base Dcoker image to the latest.

Related issues

Closes #56
Closes #60

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 8, 2025
@behnazh-w behnazh-w force-pushed the behnazh/remove-mvnw-gradlew branch 4 times, most recently from 5eb92e9 to e930b66 Compare August 11, 2025 00:44
@behnazh-w behnazh-w marked this pull request as ready for review August 11, 2025 01:53
@behnazh-w behnazh-w requested a review from tromai as a code owner August 11, 2025 01:53
@tromai
Copy link
Member

tromai commented Aug 12, 2025

For mvnw and gradlew used in SBOM generation, we mount $HOME/.m2 and $HOME/.gradle within the container to output/.m2 and output/.gradle in the host filesystem AND mount any ~/.m2/settings/xml and ~/.gradle/gradle.property from the host machine to ~/.m2/settings/xml and ~/.gradle/gradle.property within the container. It happens in run_macaron.sh

We probably don't need to mount them anymore. Removing these location also requires us to update

Some other locations:

@behnazh-w
Copy link
Member Author

we mount $HOME/.m2

Thanks for spotting the leftover references in run_macaron.sh. I think the .m2 directory should still be mounted for the GitHub attestation feature or analyzing JAR files.

@behnazh-w
Copy link
Member Author

we mount $HOME/.m2

Thanks for spotting the leftover references in run_macaron.sh. I think the .m2 directory should still be mounted for the GitHub attestation feature or analyzing JAR files.

See commit 5d13ecc.

@behnazh-w behnazh-w force-pushed the behnazh/remove-mvnw-gradlew branch from 5d13ecc to 481a08f Compare August 14, 2025 01:02
Copy link
Member

@tromai tromai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have finished my first round of review.

@behnazh-w behnazh-w force-pushed the behnazh/remove-mvnw-gradlew branch from aa63089 to f8f5431 Compare August 15, 2025 03:41
Copy link
Member

@tromai tromai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the changes!

@behnazh-w behnazh-w force-pushed the behnazh/remove-mvnw-gradlew branch from f8f5431 to 99973a1 Compare August 15, 2025 05:02
@behnazh-w behnazh-w merged commit 6785ac4 into main Aug 15, 2025
8 checks passed
@behnazh-w behnazh-w deleted the behnazh/remove-mvnw-gradlew branch August 15, 2025 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CycloneDX Gradle plugin has non-detereminitic behavior Merge generated BOMs for mono repositories with multiple projects
2 participants