Repository navigation
chore(QTDI-3796): copy settings.xml for Trivy scan - #1322
Conversation
Trivy pom resolver ignores MAVEN_ARGS and -s. It reads only ~/.m2/settings.xml. Copy .jenkins/settings.xml there before the scan so the Nexus mirror is used. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Scope & design review — QTDI-3796
Approval gate: APPROVED — no Blocker or Major findings. Signed: Claude Sonnet 5.5 |
Code Review — QTDI-3796Reviewed 2 files: Jenkinsfile, ci/Jenkinsfile-trivy. Both are CI Groovy files; no Java, TCK, or test rules apply. Cause comment present, no secrets, license headers untouched. Severity counts: Critical fixed: 0, Warnings: 0, Info: 0. Signed: Claude Sonnet 5.5 |
|
To copy the setting.xml into the pod we needed to create an artifical mount inside yml https://github.com/Talend/connectors-lib/blob/main/.jenkins/jenkins_pod.yml
I think this one needs it too |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Review round 1 — summary
Fixes pushed: Round summary generated by AI. Please resolve threads after verifying the fixes. Signed: Claude Sonnet 5.5 |
There was a problem hiding this comment.
🟡 Changes recommended
The Jenkins pod still has an unresolved moderate permission issue that may prevent copying to the root-owned emptyDir and stop Trivy from starting.
1 open issue
What changed in this PR
Updates both Jenkins Trivy pipelines so Trivy can resolve Maven dependencies through the Nexus mirror by copying .jenkins/settings.xml into the default Maven settings location.
Changes:
- Copies
.jenkins/settings.xmlto${HOME}/.m2/settings.xmlbefore each Trivy scan. - Adds a temporary
.m2volume while retaining the persistent Maven repository mount. - Requires human-triggered Jenkins validation of the Trivy scan and volume permissions.
| File | Description |
|---|---|
| Jenkinsfile | Copies the Maven settings file before the standard pipeline's Trivy report generation. |
| ci/Jenkinsfile-trivy | Copies the Maven settings file before the dedicated Trivy security scan. |
| .jenkins/jenkins_pod.yml | Adds temporary storage and a mount for the Maven settings directory while preserving the repository cache mount. |
Review effort: Lite
|
Review round 1 — summary
Fixes pushed: none Round summary generated by AI. Please resolve threads after verifying. |
* fix(QTDI-3796): Copy settings.xml for Trivy scan Trivy pom resolver ignores MAVEN_ARGS and -s. It reads only ~/.m2/settings.xml. Copy .jenkins/settings.xml there before the scan so the Nexus mirror is used. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(QTDI-3796): address review round 1 — mount emptyDir on ~/.m2 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit c27a205)
* fix(QTDI-3796): Copy settings.xml for Trivy scan Trivy pom resolver ignores MAVEN_ARGS and -s. It reads only ~/.m2/settings.xml. Copy .jenkins/settings.xml there before the scan so the Nexus mirror is used. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(QTDI-3796): address review round 1 — mount emptyDir on ~/.m2 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit c27a205)
…COMP-api-test #1317) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (62.30% Estimated after merge)
Summary
Trivy scans in
Jenkinsfileandci/Jenkinsfile-trivydo not use the Nexus mirror. The Trivy pom resolver ignoresMAVEN_ARGSand-s. It reads only~/.m2/settings.xml.This PR copies
.jenkins/settings.xmlto~/.m2/settings.xmlbeforetrivyTools.generateTrivyReport. Same approach as QTDI-3279.Jira: QTDI-3796
Checklist
AI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code
AI contribution metrics
100%100%100%