-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(java): add flag for java scan options #6375
fix(java): add flag for java scan options #6375
Conversation
Could you give me an example? Maven works in the same way, no? Why is Trivy so slow? |
@knqyf263 I'm exploring the Maven repository. |
Closed in favor of #6412 |
Description
After #6171, increased Trivy runtime for
pom.xml
files.This is due to repositories which contains in pom.xml files, but don't contain dependencies (e.g. when we try to find release dependencies, but repository only contains snapshot dependencies).
To avoid this, we add new flag -
java-scan-options
.This flag is required to set options to scan java files:
trivy-java-db
- to allow the use oftrivy-java-db
when scanningjar
files (without this flag Trivy doesn't download/use trivy-java-db).maven-central
to enable maven central as repository to search dependencies, if local cache doesn't contain them.releases
- to enable release repositories forpom.xml
files.snapshots
- to enable snapshot repositories forpom.xml
files.offline
1 - to disable all previous options.trivy-java-db
(take GAV2 only frompom.properties
andMANIFEST.MF
files).pom.xml
files.By default we enable
trivy-java-db
andmaven-central
options (as it was before #6171).Warning
This PR marks the
--offline-scan
flag as deprecated.--java-scan-options offline
should be used instead of the flag.Related issues
Related PRs
Checklist
Footnotes
This option replace --offline-scan flag. ↩
GroupID, ArtifactID and Version of artifact. ↩