Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBOM generation should fail on unknown pom.xml dependency #1433

Open
metametadata opened this issue Oct 24, 2024 · 0 comments
Open

SBOM generation should fail on unknown pom.xml dependency #1433

metametadata opened this issue Oct 24, 2024 · 0 comments
Labels

Comments

@metametadata
Copy link
Contributor

pom.xml with the non-existent abc/def dependency:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>foo</groupId>
  <artifactId>bar</artifactId>
  <packaging>jar</packaging>
  <version>1.0.0</version>
  <name>foo</name>
  <dependencies>
    <dependency>
      <groupId>abc</groupId>
      <artifactId>def</artifactId>
      <version>1.2.3</version>
    </dependency>
  </dependencies>
</project>

Command:

CDXGEN_DEBUG_MODE=debug PREFER_MAVEN_DEPS_TREE=true cdxgen --fail-on-error --no-include-formulation --no-recurse --output sbom.json --type java

Expected

The command fails with non-0 exit code, sbom.json is not generated.

Actual

Exit code 0, sbom.json is generated.

@prabhu prabhu added the maven label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Seeking sponsors
Development

No branches or pull requests

2 participants