fix(QTDI-3123): Also deploy SNAPSHOTs to internal Nexus on master builds#1252
Conversation
On master/maintenance builds (stdBranch_buildOnly=true), add a second mvn deploy call using -Pprivate_repository to publish SNAPSHOTs to artifacts-zl.talend.com in addition to central.sonatype.com. connector-se Jenkins agents cannot reach central.sonatype.com (network blocked), causing PR builds to fail with 'Connection reset' when component-runtime.version references a SNAPSHOT version. Co-Authored-By: GitHub Copilot <copilot@github.com>
Co-Authored-By: GitHub Copilot <copilot@github.com>
🔍 Scope & Design Review — Round 1
Approval rationale
✅ Compliance Check
|
There was a problem hiding this comment.
Pull request overview
Updates the CI pipeline so master/maintenance builds publish SNAPSHOT artifacts not only to Sonatype Central Portal snapshots, but also to the internal Nexus (artifacts-zl.talend.com) to unblock downstream builds that cannot reach central.sonatype.com.
Changes:
- Add a second
mvn deployinvocation onstdBranch_buildOnlybuilds, activatingprivate_repositoryto deploy SNAPSHOTs to internal Nexus. - Extend the Jenkins job description to mention the additional internal Nexus deployment on standard branches.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (stdBranch_buildOnly) { | ||
| JenkinsStatusController.jobDescriptionAppend("Maven artefact also deployed as ${finalVersion} on [artifacts-zl.talend.com](https://artifacts-zl.talend.com/nexus/content/repositories/snapshots/org/talend/sdk/component) ") | ||
| } |
There was a problem hiding this comment.
Fixed in 02876ad0049 — extracted the Nexus snapshot URL to a local nexusSnapshotUrl variable in the description script {} block; both repo[1] (devBranch path) and the jobDescriptionAppend (stdBranch path) now reference the variable.
| // can resolve SNAPSHOT dependencies. | ||
| script { | ||
| if (stdBranch_buildOnly) { | ||
| def nexusDeployOptions = "$skipOptions --activate-profiles private_repository -Denforcer.skip=true" |
There was a problem hiding this comment.
there could be a global variable called nexusDeployOptions (cf line 474) which will be used twice:
- line 286:
deployOptions = nexusDeployOptions - line 479
simply move the line 474 higher in the code in order to declare a global variable nexusDeployOptions
There was a problem hiding this comment.
Fixed in 02876ad0049 (incorporating @thboileau's guidance in the reply below) — added String nexusDeployOptions = "$skipOptions --activate-profiles private_repository -Denforcer.skip=true" as a global variable next to skipOptions/deployOptions. The devBranch qualify block now uses deployOptions = nexusDeployOptions and the stdBranch deploy uses the global directly; the local def nexusDeployOptions has been removed.
- Fix typo in comment: connector-se -> connectors-se - Extract nexusDeployOptions as global variable; reuse at devBranch qualify block (line 286) and stdBranch deploy - Extract nexusSnapshotUrl as local variable in description block to eliminate duplicated URL Co-Authored-By: GitHub Copilot <copilot@github.com>
Review round 1 — summary
|
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (0.00% Estimated after merge)
Requirements
Why this PR is needed?
PR #1515 (QTDI-1369) bumped
component-runtime.versionfrom1.93.0→1.94.0-SNAPSHOTinconnectors-se. This caused persistent Jenkins build failures: theconnectors-seJenkins agents cannot reachcentral.sonatype.com(network blocked), andcomponent-runtimemaster builds were deploying SNAPSHOTs only tocentral.sonatype.com— not to the internal Nexus (artifacts-zl.talend.com). Maven caches the resolution failure, causing all subsequent builds to fail.Jira ticket: QTDI-3123
What does this PR adds (design/code thoughts)?
In the
Maven deploystage ofJenkinsfile, adds a secondmvn deploycall guarded byif (stdBranch_buildOnly)(master/maintenance builds only). The call activates-Pprivate_repositoryto also publish SNAPSHOTs toartifacts-zl.talend.com/nexus/content/repositories/snapshotsusingnexusCredentials(no GPG signing needed for internal Nexus).Why two separate Maven invocations? Activating both
-Possrh -Psnapshotand-Pprivate_repositoryin a single call would deploy only to Nexus becauseprivate_repositoryoverridessnapshotRepository. Two separate calls are the only correct way to publish to both endpoints.Compliance notes (committed history — not rewritten):
bash mvn deploytypo in the first deploy call is out of scope per approved planAI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code