Repository navigation
Support Maven mirrors in generated settings.xml - #1288
Closed
brunoborges wants to merge 1 commit into
Closed
brunoborges wants to merge 1 commit into
brunoborges wants to merge 1 commit 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.
🟢 Approval recommended
No blocking issues remain in input handling, settings generation, compatibility, or coverage.
0 open findings
What changed in this PR
Adds mvn-mirrors support to generated Maven settings, addressing #1287 by redirecting repositories independently of repository profiles.
Changes:
- Parses mirror entries, validates required fields and unique IDs, and escapes generated XML.
- Documents public and authenticated mirrors.
- Adds regression tests, cross-platform workflow coverage, and rebuilt bundles.
| File | Description |
|---|---|
| src/constants.ts | Defines the mirror input constant. |
| src/auth.ts | Parses mirrors and generates settings XML. |
| README.md | Introduces the mirror input. |
| docs/advanced-usage.md | Documents configuration and selector behavior. |
| dist/setup/index.js | Bundles the new input constant. |
| dist/setup/81.index.js | Bundles mirror parsing and generation. |
| dist/cleanup/index.js | Refreshes bundled constants. |
| action.yml | Declares the optional input. |
| .github/workflows/e2e-publishing.yml | Checks mirror selection across platforms. |
| tests/auth.test.ts | Covers parsing, XML, and settings compatibility. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3 tasks done
| with: | ||
| persist-credentials: false | ||
| - name: Configure Maven mirrors without repository inputs | ||
| uses: ./ |
Comment on lines
+360
to
+364
| const scheme = /^[A-Za-z][A-Za-z0-9+.-]*:/.exec(remainder)?.[0] ?? ''; | ||
| const fields = | ||
| /^(.*?):((?:\s*!?external:(?:http:)?\*\s*|[^:,]*)(?:,(?:\s*!?external:(?:http:)?\*\s*|[^:,]*))*)$/.exec( | ||
| remainder.slice(scheme.length) | ||
| ); |
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.
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.