Skip to content

Add support for multiple Maven servers - #1239

Merged
brunoborges merged 1 commit into
mainfrom
brunoborges-support-multiple-maven-servers
Aug 17, 2026
Merged

Add support for multiple Maven servers#1239
brunoborges merged 1 commit into
mainfrom
brunoborges-support-multiple-maven-servers

Conversation

@brunoborges

Copy link
Copy Markdown
Contributor

Description:
Maven workflows that publish to separate release, snapshot, or private repositories currently have to generate or patch settings.xml themselves. This adds a structured mvn-server-credentials multiline input that generates multiple ordered <server> entries from environment variable names.

The parser rejects malformed entries and duplicate server IDs, while existing single-server inputs and deprecated aliases remain the fallback when the new input is absent. XML escaping, GPG profile behavior, settings overwrite handling, documentation, tests, and checked-in action bundles are updated consistently.

Related issue:
Fixes: #85

Check list:

  • Ran npm run check locally (format, lint, build, test) and all checks pass.
  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 17, 2026 21:01
@brunoborges
brunoborges requested a review from a team as a code owner August 17, 2026 21:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class support for configuring multiple Maven <server> credential entries in the generated settings.xml, enabling workflows to publish to release/snapshot/private repositories without custom settings.xml patching. It introduces a new multiline input (mvn-server-credentials) that is parsed, validated (malformed entries + duplicate IDs rejected), and used preferentially while preserving the existing single-server inputs (and deprecated aliases) as a fallback.

Changes:

  • Add a new mvn-server-credentials multiline input and plumb it through authentication settings generation.
  • Implement parsing/validation for multiple server credential entries and update settings.xml generation to emit multiple ordered <server> blocks.
  • Update docs, tests, and bundled dist/ artifacts to match the new behavior.
Show a summary per file
File Description
src/constants.ts Adds the mvn-server-credentials input constant.
src/auth.ts Adds parsing + selection logic for multiple servers and updates settings.xml generation to emit multiple <server> entries.
tests/auth.test.ts Adds coverage for parsing, validation, precedence rules, and multi-server XML output ordering.
action.yml Documents the new multiline input at the action interface level.
README.md Adds the new input to the published inputs table.
docs/advanced-usage.md Adds an “Publishing to multiple Maven servers” section with an example and expected XML output.
dist/setup/index.js Updates bundled constants export to include the new input.
dist/setup/81.index.js Updates bundled auth logic for multi-server parsing/generation.
dist/cleanup/index.js Updates bundled constants to include the new input (unused in cleanup).

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 6/9 changed files
  • Comments generated: 0
  • Review effort level: Lite
@brunoborges
brunoborges merged commit a42a52c into main Aug 17, 2026
86 checks passed
@brunoborges
brunoborges deleted the brunoborges-support-multiple-maven-servers branch August 17, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants