Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-5659] Provide project-specific settings located in ${session.rootdir}/.mvn/settings.xml by default #1059

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 16, 2023

This add support for project specific settings using:

  • a default location of ${session.rootDirectory}/.mvn/settings.xml
  • an alternate location specified by -ps or --project-settings and resolved against the current dir if provided with a relative path

Note that project settings have some limitations:

  • no localRepository
  • no interactiveMode
  • no offline
  • no proxies
  • no server[x].username, server[x].password, server[x].privateKey, server[x].passphrase, server[x].filePermissions, server[x].directoryPermissions
  • no usePluginRegistry

Simple IT provided with apache/maven-integration-testing#265

===
Related discussions to be considered (but note that this PR does not depend on the following):

  • MNG-6762 suggests to also modify other file resolution, but there was a strong opposition to modify the existing behaviour. This PR is coherent with the current code where relative files are resolved against the current directory.

@gnodet gnodet marked this pull request as draft March 16, 2023 12:35
@gzm55
Copy link
Contributor

gzm55 commented Mar 16, 2023

usePluginRegistry in project settings should also be ignored.

@rmannibucau
Copy link
Contributor

Can ${maven.multiModuleProjectDirectory}/.mvn/settings.xml become ${maven.multiModuleProjectDirectory}/.mvn/project.settings.xml or something like that since .mvn/settings.xml is sometimes used by users so something more unlikely would be great.

@gnodet gnodet changed the title [MNG-5659] Provide project-specific settings located in [root]/.mvn/settings.xml by default [MNG-5659] Provide project-specific settings located in ${session.rootdir}/.mvn/settings.xml by default Apr 14, 2023
@gnodet gnodet marked this pull request as ready for review April 14, 2023 14:03
@gnodet gnodet added this to the 4.0.0-alpha-6 milestone May 16, 2023
Copy link
Member

@cstamas cstamas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I like this, I'd generalize the approach (maybe no now) in similar way like "chained LRM" works. Example:

-s remains as today "user settings override"
And "settings tail" is s1, s2, s3.... global setting (that also can be overridden from CLI). And this list is ordered from "most dominant" to "most recessive", meaning, that even settings builder could be modified to make a for-loop to build effective settings in this order:
"user settings", s1, s2, s3.... "global settings"

@gnodet gnodet force-pushed the MNG-5659-project-settings branch from 945bdb2 to fe5bf55 Compare June 15, 2023 19:04
@gnodet gnodet merged commit e6303aa into apache:master Jun 19, 2023
18 checks passed
@gnodet gnodet deleted the MNG-5659-project-settings branch June 20, 2023 06:33
@gnodet gnodet mentioned this pull request Sep 20, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants