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

Issue while mapping DependencyScope from maven dependency tree #858

Closed
tarun06 opened this issue Oct 16, 2023 · 1 comment · Fixed by #1033
Closed

Issue while mapping DependencyScope from maven dependency tree #858

tarun06 opened this issue Oct 16, 2023 · 1 comment · Fixed by #1033
Assignees
Labels
detector:maven The Maven detector status:waiting-on-response Waiting on a response/more information from the user type:bug Bug fix of existing functionality

Comments

@tarun06
Copy link
Contributor

tarun06 commented Oct 16, 2023

Method name -> MavenParsingUtilities -> GetMavenComponentStringInfo

On using below dependency with scope -> compile, in Maven Project,

<dependency>
	<groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
	<version>4.8.0</version>
	<scope>compile</scope>
  </dependency> 

The SBOM throws an exception

System.InvalidOperationException: Invalid scope ('linux-x86_64') found for 'io.netty:netty-transport-native-epoll:jar:4.1.87.Final:linux-x86_64' found in generated dependency graph

More Info ->

Dependency tree generated using maven dependency CLI command

mvn dependency:tree -B -DoutputFile=bcde.mvndeps -DoutputType=text -f <SampleProjectPath>, contains value linux-x86_64 and osx-x86_64 which further leads to an exception while parsing dependency Scope.

Snapshot of Dependency tree

|  |  +- com.beust:jcommander:jar:1.82:compile
|  |  +- io.netty:netty-buffer:jar:4.1.87.Final:compile
|  |  +- io.netty:netty-codec-http:jar:4.1.87.Final:compile
|  |  |  +- io.netty:netty-codec:jar:4.1.87.Final:compile
|  |  |  \- io.netty:netty-handler:jar:4.1.87.Final:compile
|  |  +- io.netty:netty-common:jar:4.1.87.Final:compile
|  |  +- io.netty:netty-transport-classes-epoll:jar:4.1.87.Final:compile
|  |  +- io.netty:netty-transport-classes-kqueue:jar:4.1.87.Final:compile
|  |  +- io.netty:netty-transport-native-epoll:jar:4.1.87.Final:linux-x86_64
|  |  +- io.netty:netty-transport-native-kqueue:jar:4.1.87.Final:osx-x86_64
|  |  +- io.netty:netty-transport-native-unix-common:jar:4.1.87.Final:compile

AB#2114682

@cobya cobya added detector:maven The Maven detector bug labels Oct 18, 2023
@cobya cobya removed the bug label Dec 1, 2023
@cobya cobya added status:waiting-on-response Waiting on a response/more information from the user type:bug Bug fix of existing functionality labels Mar 14, 2024
@RushabhBhansali
Copy link
Contributor

RushabhBhansali commented Mar 14, 2024

upon investigating further, found that maven considers any value as a valid scope and replaces it with default. However, while printing dependency:tree, the invalid scope is preserved as is.

Solution:
We will match CD behavior to maven's where we detect invalid scope as "Compile".

@grvillic grvillic linked a pull request Mar 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detector:maven The Maven detector status:waiting-on-response Waiting on a response/more information from the user type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants