Repository navigation
Support Maven mirrors in generated settings.xml - #1289
Open
brunoborges wants to merge 3 commits into
Open
brunoborges wants to merge 3 commits into
brunoborges wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4
Contributor
There was a problem hiding this comment.
🟡 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.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description:
Add optional
mvn-mirrorsinput with multilinemirror-id:mirror-url:mirror-ofentries and generate top-level Maven<mirrors>settings independently of repository profiles.Preserve URL schemes/ports and selectors such as
external:*andexternal: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.*andexternal:*— 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:
npm run checklocally (format, lint, build, test) and all checks pass.