Skip to content

Respect settings.xml mirror repository definition - #90

Open
iuliand-db wants to merge 2 commits into
sbt:mainfrom
iuliand-db:dragos/fix-settings-mirrors
Open

Respect settings.xml mirror repository definition#90
iuliand-db wants to merge 2 commits into
sbt:mainfrom
iuliand-db:dragos/fix-settings-mirrors

Conversation

@iuliand-db

@iuliand-db iuliand-db commented Apr 3, 2026

Copy link
Copy Markdown

Noticed this in the Spark build. Internally we are using a maven mirror that we'd like to keep as a user setting, instead of adding it to code. Seems like other settings in settings.xml are picked up, so picking up any defined mirrors seems in line with the general approach.

@gemelen

gemelen commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

@iuliand-db thank you for your contribution.

Do you mind to modify your changeset to be more flexible regardint to the settings.xml location? There are different ways to point Maven about its directories:

  • to conform to XDG paths, for example, via ${maven.home}/conf/settings.xml
  • via -gs,--global-settings <arg>(Alternate path for the global settings file)
    and probably more.

If you don't have time for that, I'll rework your PR, but it'd be a bit later in time.

For reference, https://issues.apache.org/jira/browse/MNG-6603

@iuliand-db

iuliand-db commented Apr 6, 2026

Copy link
Copy Markdown
Author

@iuliand-db thank you for your contribution.

Do you mind to modify your changeset to be more flexible regardint to the settings.xml location? There are different ways to point Maven about its directories:

Note that settings.xml were processed already from ~/.m2/settings.xml before this patch, so these changes are orthogonal to my fix. I'd prefer to not block it until the larger configuration issue is reworked.

EDIT: I was wrong, there's a setting to point to the settings location. I pushed a new commit to respect the setting and added a scripted-test.

  • to conform to XDG paths, for example, via ${maven.home}/conf/settings.xml

Looking a bit deeper into this, the original issue is still open, and there are some changes in maven 4 (currently, sbt-pom-reader depends on maven 3.9) to support maven.properties which could be used to pick up XDG_ environment variables.

  • via -gs,--global-settings <arg>(Alternate path for the global settings file)
    and probably more.

These are maven command line arguments, if I'm not mistaken, which don't have an equivalent in sbt. Since there's already an sbt setting to point to the settings.xml file, perhaps we can get 90% there by just respecting this setting (which can be configured to pick up environment variables if needed.

If you don't have time for that, I'll rework your PR, but it'd be a bit later in time.

For reference, https://issues.apache.org/jira/browse/MNG-6603

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.

2 participants