[ https://issues.apache.org/jira/browse/MNG-5659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699135#comment-17699135 ]
Nils Breunese edited comment on MNG-5659 at 3/10/23 10:59 PM: -------------------------------------------------------------- I'm not sure I'd be considered as someone mastering Maven (although they do call me Dr. Pom at work :)), but at my company we have over 1000+ Maven projects with project-specific {{settings.xml}} files, because it is just super-valuable for projects to be buildable right after cloning them, requiring no more than a JDK installed on the host system. Maven Wrapper pulls in the configured Maven version and {{.mvn/maven.config}} contains {{--settings=.mvn/settings.xml}} for any project-specific settings. This setup works fine as long as you always call {{./mvnw}} from the root of a project, but breaks down when you want to run Maven from a subdirectory/submodule, because suddenly {{\--settings=.mvn/settings.xml}} points to the wrong location. If Maven would always look for {{settings.xml}} in a specific project-specific location, then we would be able to drop the {{\--settings}} entry from all {{.mvn/maven.config}} files and just run Maven from anywhere in a project. was (Author: breun): I'm not sure I'd be considered as someone mastering Maven (although they do call me Dr. Pom at work :)), but at my company we have over 1000+ Maven projects with project-specific {{settings.xml}} files, because it is just super-valuable for projects to be buildable right after cloning them, requiring no more than a JDK installed on the host system. Maven Wrapper pulls in the configured Maven version and {{.mvn/maven.config}} contains {{--settings=.mvn/settings.xml}} for any project-specific settings. This setup works fine as long as you always call {{./mvnw}} from the root of a project, but breaks down when you want to run Maven from a subdirectory/submodule, because suddenly {{\--settings=.mvn/settings.xml}} points to the wrong location. If Maven would always look for {{settings.xml}} in a specific project-specific location, then we would be able to drop the {{--settings}} entry from all {{.mvn/maven.config}} files and just run Maven from anywhere in a project. > Project specific settings.xml > ----------------------------- > > Key: MNG-5659 > URL: https://issues.apache.org/jira/browse/MNG-5659 > Project: Maven > Issue Type: New Feature > Components: FDPFC > Reporter: Joachim Van der Auwera > Priority: Major > Fix For: Issues to be reviewed for 4.x > > Attachments: mvn.patch > > > It would be useful to have a settings.xml file next to the project pom that > could contain project specific settings. For example, when switching between > projects it is sometimes necessary to also change the location of the local > repository, or use a different set of repositories and/or mirror settings for > each project. > If a settings.xml file could be included with a project checkout, then the > repositories needed for the build could be included (instead of putting them > in the pom) along with any other project specific settings. > The tricky part is intelligently handling multi-module projects. For a > multi-module project I don't want to include a separate settings.xml file for > each directory. So Maven could recursively check each parent directory until > it either (1) finds a settings.xml, (2) finds a directory with no pom.xml, or > (3) finds the root directory. -- This message was sent by Atlassian Jira (v8.20.10#820010)