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

Refine license search from groupIDFromJavaMetadata to account for artfactId in the groupId #2313

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

coheigea
Copy link
Contributor

@coheigea coheigea commented Nov 13, 2023

Sometimes, the groupId that is obtained from groupIDFromJavaMetadata is not quite correct, in that it contains some version of the artifactId in the path. For example:

https://repo1.maven.org/maven2/com/jayway/jsonpath/json-path/2.4.0/

Syft doesn't find a license because the groupId is com.jayway.jsonpath.json-path instead of com.jayway.jsonpath. Also:

https://repo1.maven.org/maven2/com/google/api/api-common/2.2.0/

Syft doesn't find a license because the groupId is com.google.api.apicommon instead of com.google.api.

The PR falls back to stripping the last package name from the groupId to see if it can find a pom from Maven central. Licenses are found correctly for the two examples above.

…ving the artfactId in the groupId

Signed-off-by: Colm O hEigeartaigh <coheigea@apache.org>
@spiffcs spiffcs merged commit 3e8a230 into anchore:main Nov 15, 2023
10 checks passed
@coheigea coheigea deleted the coheigea/groupIDFromJavaMetadata2 branch November 16, 2023 06:18
@wagoodman wagoodman changed the title Refine license searching from groupIDFromJavaMetadata to allow for ha… Refine license search from groupIDFromJavaMetadata to account for artfactId in the groupId Nov 16, 2023
@wagoodman wagoodman added the bug Something isn't working label Nov 16, 2023
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
…ving the artfactId in the groupId (anchore#2313)

Signed-off-by: Colm O hEigeartaigh <coheigea@apache.org>
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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants