Skip to content

Support Maven mirrors in generated settings.xml - #1289

Open
brunoborges wants to merge 3 commits into
mainfrom
brunoborges-support-maven-mirrors-in-generated-setti
Open

brunoborges wants to merge 3 commits into
mainfrom
brunoborges-support-maven-mirrors-in-generated-setti

Conversation

@brunoborges

Copy link
Copy Markdown
Contributor

Description:
Add optional mvn-mirrors input with multiline mirror-id:mirror-url:mirror-of entries and generate top-level Maven <mirrors> settings independently of repository profiles.

Preserve URL schemes/ports and selectors such as external:* and external:http:*; reject missing fields and duplicate IDs; escape generated XML. Authenticated mirrors use matching server IDs, while public mirrors need no matching credentials. Existing repository/Central controls, GPG settings, custom paths, and overwrite behavior remain unchanged.

Includes documentation, regression tests, cross-platform Maven mirror-selection workflow coverage, and rebuilt action bundles. Replaces #1288 using the branch published directly in actions/setup-java.

Validation:

  • npm run check — passed: formatting, lint, build, and all 45 test suites / 1,585 tests.
  • npx tsc --noEmit — passed.
  • New PowerShell workflow assertions executed locally against Maven 3.9.15 for * and external:* — passed, confirming Central and POM-declared dependency/plugin repository redirection. GitHub-hosted Windows/Linux jobs have not been run locally.

Related issue:
Fixes #1287

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-Session: 59df028a-0d1b-49cb-8126-ab26408663e4
@brunoborges
brunoborges requested a review from a team as a code owner October 16, 2026 13:51
Copilot AI balanced review requested due to automatic review settings October 16, 2026 13:51

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.

🟡 Changes recommended

Missing selectors in port-bearing or IPv6 URLs can silently produce ineffective mirrors instead of failing validation.

1 open finding
What changed in this PR

Adds mvn-mirrors to setup-java’s Maven settings generation, allowing repository redirection independently of repository profiles.

Changes:

  • Parses mirror entries and generates escaped, top-level XML.
  • Documents authentication and selector behavior.
  • Adds regression and cross-platform workflow coverage, with rebuilt bundles.
File Description
src/​constants.ts Defines the mirror input constant.
src/​auth.ts Parses mirrors and generates settings.
README.md Introduces mirror configuration.
docs/​advanced-usage.md Documents usage and authentication.
dist/​setup/​index.js Includes the new input constant.
dist/​setup/​81.index.js Bundles mirror handling.
dist/​cleanup/​index.js Refreshes bundled constants.
action.yml Declares the optional input.
.github/​workflows/​e2e-publishing.yml Checks Maven mirror selection across platforms.
tests/​auth.test.ts Covers parsing, XML generation, and compatibility.

🧠 Review effort: Balanced


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

Comment thread src/auth.ts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4
Comment thread .github/workflows/e2e-publishing.yml Fixed
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4

This branch has not been deployed

No deployments
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.

Support Maven mirrors in generated settings.xml

3 participants