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

Fix merge multiple pom imports #91

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

jkroepke
Copy link
Contributor

@jkroepke jkroepke commented Apr 5, 2022

In maven, a definition of a dependency will not override by any other definition.

% mvn -s testdata/conf/settings.xml -f testdata/import-dependency-management-multiple dependency:tree  | grep example-api
[ERROR] Failed to execute goal on project import: Could not resolve dependencies for project com.example:import:pom:2.0.0: org.example:example-api:jar:1.7.30 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

Previously, go-dep-parser detects version 1.1.1, since its defined in the second import bom.

See also: aquasecurity/trivy#1943

@CLAassistant
Copy link

CLAassistant commented Apr 5, 2022

CLA assistant check
All committers have signed the CLA.

@knqyf263 knqyf263 self-requested a review April 5, 2022 15:46
@knqyf263 knqyf263 merged commit 71021a4 into aquasecurity:main Apr 6, 2022
@knqyf263
Copy link
Collaborator

knqyf263 commented Apr 6, 2022

Great contribution! Thanks!!

@jkroepke jkroepke deleted the fix-merge-multiple-imports branch April 6, 2022 07:48
@knqyf263
Copy link
Collaborator

knqyf263 commented Apr 6, 2022

To fix the issue in Trivy, you need to

  1. Update fanal pointing to the new go-dep-parser
    • go get -u github.com/aquasecurity/go-dep-parser@71021a481237f5285d64137336479bd3bda91c09 && go mod tidy
  2. Update trivy pointing to the updated fanal
    • go get -u github.com/aquasecurity/fanal@[COMMIT_HASH] && go mod tidy

@jkroepke
Copy link
Contributor Author

jkroepke commented Apr 6, 2022

Hi @knqyf263

thanks for the instructions. Is there are go mod command to archive this on fanal? Close to zero experience in golang here.

@jkroepke
Copy link
Contributor Author

jkroepke commented Apr 6, 2022

Thanks. aquasecurity/fanal#457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants