Feature Request: Option to Ignore Transitive Maven Repositories during POM Resolution #10497
philippe-granet
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
When scanning Maven projects, Trivy attempts to resolve dependencies by following all repositories declared in the dependency tree, including those introduced transitively via pom.xml files. This behavior can lead to network issues, timeouts, and failed scans in constrained or secured environments (e.g., CI runners with restricted outbound access).
In particular, transitive dependencies may introduce remote repositories such as Sonatype snapshot repositories that are:
This results in repeated connection failures like
dial tcp <ip>:443: connect: network is unreachableand ultimately causes the scan to fail due to timeout.Expected Behavior
Trivy should provide an option to ignore remote repositories declared in transitive dependencies, and instead restrict resolution to:
This behavior is similar to Maven CLI option
--ignore-transitive-repositories:https://maven.apache.org/ref/3.9.14/maven-embedder/cli.html
-itr,--ignore-transitive-repositories: If set, Maven will ignore remote repositories introduced by transitive dependencies.Proposed Solution
Introduce a new CLI flag, for example
--maven-ignore-transitive-repositoriesWhen enabled:
Use Case / Motivation
This is particularly useful in:
Current Workarounds
None of these approaches provide a clean or deterministic solution.
Impact
Adding this option would:
Environment
Additional Context
Example errors encountered:
These repositories are not explicitly defined in the project but are introduced transitively.
Target
Git Repository
Scanner
Vulnerability
Beta Was this translation helpful? Give feedback.
All reactions