Skip to content

fix(mavenBuild): use Maven 3.x altDeploymentRepository format (id::url)#5810

Open
fskhiri wants to merge 7 commits into
masterfrom
fskhiri/fix-mavenBuild
Open

fix(mavenBuild): use Maven 3.x altDeploymentRepository format (id::url)#5810
fskhiri wants to merge 7 commits into
masterfrom
fskhiri/fix-mavenBuild

Conversation

@fskhiri

@fskhiri fskhiri commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Problem

The mavenBuild step was generating the -DaltDeploymentRepository flag in the legacy three-token format
(id::default::url), which is not supported by maven-deploy-plugin 3.0.0+. Pipelines using that plugin
version would fail at the deploy phase with an invalid repository format error.

Solution

Drop the ::default:: layout token and emit the Maven 3.x two-token format (id::url) instead, as required by
maven-deploy-plugin 3.x.

Changes

  • cmd/mavenBuild.go: remove the ::default:: layout segment from the altDeploymentRepository flag value
  • cmd/mavenBuild_test.go: update assertion to match the new two-token format
  • resources/metadata/mavenBuild.yaml: update altDeploymentRepositoryID parameter description to document the
    Maven 3.x format requirement and the minimum plugin version (maven-deploy-plugin 3.0.0+)

Testing

Unit tests updated and passing. Validated end-to-end with a sample pipeline pinned to
maven-deploy-plugin:3.0.0-M1.

Checklist

  • Tests
  • Documentation
  • Inner source library needs updating

fskhiri added 3 commits June 16, 2026 14:25
Drop the legacy ::default:: layout token. maven-deploy-plugin 3.x parses
id::layout::url as id=<id>::default, which never matches the <server> entry
in settings.xml, causing 401. The correct 3.x format is id::url only.
The slice was initialized with []string{} and immediately conditionally
appended to. Go convention for zero-value slice initialization is
'var deployFlags []string', which is functionally identical but avoids
allocating an empty slice header unnecessarily.
@fskhiri fskhiri requested review from a team as code owners June 22, 2026 14:17
…rmat

The description previously lacked guidance on which maven-deploy-plugin
version is required. Users on plugin 3.0.0+ were hitting failures
because the old three-token id::layout::url form was silently dropped
in that release.

Add a note explaining that Piper emits -DaltDeploymentRepository=id::url
(Maven 3.x two-token format) and that maven-deploy-plugin 3.0.0+ is
required. Also quote the YAML description string to avoid any YAML
parser ambiguity with the embedded colons.
@fskhiri

fskhiri commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/it-go

@fskhiri

fskhiri commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/it-go

And-tab-8889
And-tab-8889 previously approved these changes Jun 29, 2026
@fskhiri fskhiri requested a review from fabienfritz June 29, 2026 12:29
Comment thread cmd/mavenBuild_test.go
Comment thread cmd/mavenBuild_test.go
fskhiri added 2 commits July 2, 2026 09:59
The existing test only covered the happy path (both ID and URL set).
The production guard uses &&, meaning a partial config must silently
skip the flag — but nothing prevented a future refactor from breaking
that invariant.

Add three subtests:
- Publish=true, ID set, URL empty  → flag must not appear
- Publish=true, URL set, ID empty  → flag must not appear
- Publish=false, ID and URL set    → deploy is skipped entirely
@fskhiri

fskhiri commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/it-go

@fskhiri fskhiri requested a review from fabienfritz July 2, 2026 14:06
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