Skip to content

Extended settings.xml - Profiles with Repo#813

Closed
Scyjin wants to merge 3 commits into
actions:mainfrom
Scyjin:main
Closed

Extended settings.xml - Profiles with Repo#813
Scyjin wants to merge 3 commits into
actions:mainfrom
Scyjin:main

Conversation

@Scyjin

@Scyjin Scyjin commented Apr 29, 2025

Copy link
Copy Markdown

Building Maven Project with dependencies of another Repository then Maven-Central.

This could be extended to support more than one repo.
Also the profile could be cut down to one overall-profile, i think.

I'm more the Backend Guy, hope its ok. :)

Description:
Extended settings.xml generation to include another Repository.
This should provide nessecary Information while building with Maven.
So your build could refer to something like Artifacts in a private github repository.

Related issue:

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Copilot AI review requested due to automatic review settings April 29, 2025 18:19
@Scyjin Scyjin requested a review from a team as a code owner April 29, 2025 18:19

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 extends the generation of the Maven settings.xml file to support an additional custom repository alongside Maven Central. Key changes include:

  • Adding new constants in src/constants.ts to handle repository configuration.
  • Updating authentication and settings generation functions in src/auth.ts to inject repository parameters.
  • Documenting the new repository configuration and inputs in docs/advanced-usage.md and action.yml.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/constants.ts New constants added to support custom repository parameters.
src/auth.ts Updated functions to process repository configuration, including profile fallback.
docs/advanced-usage.md Extended documentation to explain repository configuration usage.
action.yml Added new input definitions for repository settings.
Comments suppressed due to low confidence (1)

src/auth.ts:146

  • Add tests to verify that the settings.xml is correctly generated when repository configuration parameters are provided, ensuring that the profiles are included or omitted as intended.
profiles: repoId && profileId && repoUrl ? [profiles] : [],

Comment thread src/auth.ts
@brunoborges brunoborges added feature request New feature or request to improve the current logic maven Maven settings, toolchains, and publishing auth labels Jun 22, 2026
@brunoborges

Copy link
Copy Markdown
Contributor

Thank you for this contribution, @Scyjin — the idea of letting setup-java configure dependency-resolution repositories in the generated settings.xml is genuinely useful, and your prototype helped shape it.

I'm going to close this PR because the branch is now quite stale (April 2025) and conflicts with the recent refactor of generate() in src/auth.ts (see #1037, which restructures server generation around a structured definition). Rather than rebasing the original approach, I've captured the idea — generalized to support multiple repositories, Central inclusion/ordering, and per-repo snapshot control — in a fresh tracking issue:

➡️ #1054

That issue also notes how this composes with the credentials work in #1037 (the <repositories> half here pairs with the <servers> half there). A reworked implementation on top of current main — with tests, docs, and a structured input — would be very welcome there. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request to improve the current logic maven Maven settings, toolchains, and publishing auth

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants