Skip to content

Add Maven dependency-resolution repositories - #1240

Merged
brunoborges merged 2 commits into
mainfrom
brunoborges-configure-dependency-repositories
Aug 17, 2026
Merged

Add Maven dependency-resolution repositories#1240
brunoborges merged 2 commits into
mainfrom
brunoborges-configure-dependency-repositories

Conversation

@brunoborges

Copy link
Copy Markdown
Contributor

Description:
Maven builds that consume artifacts from private or internal repositories currently need to create or patch settings.xml themselves. This adds first-class dependency-resolution repository configuration while preserving the existing generated settings when the feature is unused.

The new mvn-repositories multiline input accepts repository-id:repository-url:snapshots-enabled entries and composes repository profiles with existing server credentials and GPG profiles. Additional inputs control whether Maven Central is included and whether it is searched first. Disabling Central emits a disabled override for Maven's Super POM repository, while an explicit central entry can replace it. The generated bundles and usage documentation are included.

Related issue:
Fixes: #1054

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: 8897ad63-2d05-4a6d-8ccd-c1155348b59e
Copilot AI lite review requested due to automatic review settings August 17, 2026 22:02
@brunoborges
brunoborges requested a review from a team as a code owner August 17, 2026 22:02

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

Adds first-class support for configuring Maven dependency-resolution repositories in the generated settings.xml, so workflows can consume dependencies from private/internal repositories without hand-writing or patching Maven settings, while preserving existing behavior when the feature is unused.

Changes:

  • Introduces new inputs (mvn-repositories, mvn-repositories-include-central, mvn-repositories-prioritize-central) and parses/validates them into structured settings.
  • Extends settings.xml generation to emit an active profile containing <repositories> (including Central ordering/disable semantics) and composes cleanly with the existing GPG profile.
  • Updates documentation, tests, and rebuilt dist/ bundles.
Show a summary per file
File Description
src/constants.ts Adds input names and Maven Central/profile constants used by the new feature.
src/auth.ts Parses repository inputs and generates <profiles>/<repositories> plus <activeProfiles> in settings.xml.
README.md Documents new inputs and adds a pointer to the advanced usage section.
docs/advanced-usage.md Adds a full usage guide and example output for custom dependency repositories.
action.yml Declares new action inputs and defaults for Central inclusion/ordering.
tests/auth.test.ts Adds unit tests for parsing and XML generation (ordering, Central disable/override, escaping, composition with GPG).
dist/setup/index.js Rebuilt bundle exporting new constants used by the action runtime.
dist/setup/81.index.js Rebuilt bundle for auth logic (parsing + settings generation updates).
dist/cleanup/index.js Rebuilt bundle reflecting newly exported constants.

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: 1
  • Review effort level: Lite
Comment thread README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@brunoborges
brunoborges merged commit 5f75b27 into main Aug 17, 2026
85 checks passed
@brunoborges
brunoborges deleted the brunoborges-configure-dependency-repositories branch August 17, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants