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

Java maven project, too many errors and warnings. #3267

Open
WestFarmer opened this issue Sep 24, 2024 · 6 comments
Open

Java maven project, too many errors and warnings. #3267

WestFarmer opened this issue Sep 24, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@WestFarmer
Copy link

WestFarmer commented Sep 24, 2024

version:

Application: syft
Version:    1.12.2
BuildDate:  2024-09-11T14:12:10Z
GitCommit:  fcd5ec951de6b3fc1f1aa2a36968356d2eb22170
GitDescription: v1.12.2
Platform:   linux/amd64
GoVersion:  go1.22.6
Compiler:   gc

used command:

syft scan dir:. -o cyclonedx=target/sbom-cyclonedx.cdx -vv

results: sbom generated, but with many errors and warns, and no dependencies in output, hence no relationships at all...

such as:

DEBUG error adding dependency dependencyID=(groupId: org.springframework.boot artifactId: spring-boot-devtools version: ) error=invalid maven pom specification, require non-empty values for groupID: 'org.springframework.boot', artifactID: 'spring-boot-devtools', version: '' mavenID=(groupId: com.wxt.itps.services artifactId: public version: 0.0.1-SNAPSHOT) pomLocation=Location<id=707 RealPath="/pom.xml">

DEBUG error attempting to resolve pom licenses error=unable to resolve pom org.springframework.boot spring-boot-starter-parent 3.2.4: %!w(<nil>) mavenID=(groupId: com.wxt.itps.services artifactId: public version: 0.0.1-SNAPSHOT)


DEBUG error attempting to find sub-group licenses error=unable to resolve pom com.wxt.itps public 0.0.1-SNAPSHOT: %!w(<nil>) mavenID=(groupId: com.wxt.itps artifactId: public version: 0.0.1-SNAPSHOT)


DEBUG unable to convert relationship type to CycloneDX JSON, dropping: "{From:0xc000347280 To:Pkg(name=\"spring-boot-devtools\" version=\"\" type=\"java-archive\" id=\"033e397b919ab6bc\") Type:contains Data:<nil>}"

tried to scan a npm project, also no dependencies element in output, while see many errors in verbose log:

[0006] DEBUG unable to convert relationship type to CycloneDX JSON, dropping: "{From:Pkg(name=\"zrender\" version=\"5.4.4\" type=\"npm\" id=\"31b5925a6366e164\") To:Location<RealPath=\"/pnpm-lock.yaml\"> Type:evident-by Data:<nil>}"
@WestFarmer WestFarmer added the bug Something isn't working label Sep 24, 2024
@WestFarmer
Copy link
Author

all those logs lack of real helpful information to address underlying problem.

@kzantow
Copy link
Contributor

kzantow commented Sep 24, 2024

@WestFarmer -- unable to resolve pom org.springframework.boot spring-boot-starter-parent 3.2.4 -- this seems to be a fairly clear message that Syft needs to resolve this POM, but was unable to. This is because Syft does not enable network resolution for anything by default. Maven, however, benefits from network resolution considerably and can be enabled with --enrich flag. (e.g. --enrich all).

That said, you still won't see any dependency relationships: the Java cataloger needs to get these implemented -- that is actively being worked on and should land reasonably soon, though.

@WestFarmer
Copy link
Author

WestFarmer commented Sep 25, 2024

@kzantow

Syft needs to resolve this POM

from where ? local maven repository or the final artifact built by maven?
all the jars and poms already in my local maven repository
all the poms already exists in the final artifact built by maven

so this still doesn't make sense

@WestFarmer
Copy link
Author

@kzantow

[ggfan@fedora 4A-services-public]$ syft scan dir:. -o syft-json=target/sbom-syft.json -vv --enrich all
unknown flag: --enrich

@wagoodman
Copy link
Contributor

@WestFarmer this was a feature newly added with syft 1.13, mind updating and trying again?

@kzantow
Copy link
Contributor

kzantow commented Sep 25, 2024

already in my local maven repository

The --enrich all will enable looking in your local maven. ~/.m2/repository for artifacts; this should help you considerably and should be very fast if no network is required 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

4 participants