[ 
https://issues.apache.org/jira/browse/MNG-5659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16865662#comment-16865662
 ] 

Nils Breunese edited comment on MNG-5659 at 6/17/19 2:41 PM:
-------------------------------------------------------------

Currently I use a {{.mvn/maven.config}} that contains the following:

{code}
--settings .mvn/settings.xml
{code}

This works when Maven is run from the project root, but when trying to run 
Maven in a subdirectory/submodule you'll get this error:

{code}
[ERROR] Error executing Maven.
java.io.FileNotFoundException: The specified user settings file does not exist: 
/path/to/current/directory/.mvn/settings.xml
{code}

It would be cool if you could specify a location relative to the project root. 
Or have a default location for {{settings.xml}} that would just always be 
found, regardless of whether you're in a subdirectory or not.

A workaround is to always call Maven from the project root and use {{-pl 
modulename}} whenever you want to limit an execution to a particular module, 
but it would sure be nice to just run Maven from any location in a project.


was (Author: breun):
Currently I use a {{.mvn/maven.config}} that contains the following:

{code}
--settings .mvn/settings.xml
{code}

This works when Maven is run from the project root, but when trying to run 
Maven in a subdirectory/submodule you'll get this error:

{code}
[ERROR] Error executing Maven.
java.io.FileNotFoundException: The specified user settings file does not exist: 
/path/to/current/directory/.mvn/settings.xml
{code}

It would be cool if you could specify a location relative to the project root. 
Or have a default location for `settings.xml` that would just always be found, 
regardless of whether you're in a subdirectory or not.

A workaround is to always call Maven from the project root and use {{-pl 
modulename}} whenever you want to limit an execution to a particular module, 
but it would sure be nice to just run Maven from any location 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
(v7.6.3#76005)

Reply via email to