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

Louis Lecaroz edited comment on MNG-5199 at 8/26/16 3:35 PM:
-------------------------------------------------------------

Yes sure Jason and Karel. 

Fully agreed with you !

But because Maven is an opened environment allowing lot of third party 
providers to propose their own plugins... Lot of them are isolating by spawning 
new mvn child instances (specially for unit tests for example). & lot of them 
cannot be configured for mentioning the settings.xml to be used. In 
consequence, the global maven settings.xml is taken in account & if you need a 
specific default setting, you will have to modify this maven\conf\settings.xml. 
& this can be a problem in ci/builds servers because sometimes, some builds 
need their own settings. So global settings need also to be isolated  to be 
modified without impacting other builds.

& one of the clean ways for doing this properly is to specify the global 
settings in the maven_opts which can be set for each of your builds.
MAVEN_OPTS & org.apache.maven.* properties appears to be the most universal way 
as the MAVEN_OPTS environment variable is generally also propagated 
automatically & some third party maven plugins can spawn child mvn instances 
thru intermediate programs or batch files which cannot be controled thru an 
API, or whatever you want.

I hope that I was able to clearly communicate the problem. being able to set 
such settings (settings, toolchain, ...) outside from the maven\conf dir will 
be great & help installations in complex environments to be more robust.

Really thx in advance
Best regards
Louis


was (Author: llecaroz):
Yes sure Jason. 

Fully agreed with you !

But because Maven is an opened environment allowing lot of third party 
providers to propose their own plugins... Lot of them are isolating by spawning 
new mvn child instances (specially for unit tests for example). & lot of them 
cannot be configured for mentioning the settings.xml to be used. In 
consequence, the global maven settings.xml is taken in account & if you need a 
specific default setting, you will have to modify this maven\conf\settings.xml. 
& this can be a problem in ci/builds servers because sometimes, some builds 
need their own settings. So global settings need also to be isolated  to be 
modified without impacting other builds.

& one of the clean ways for doing this properly is to specify the global 
settings in the maven_opts which can be set for each of your builds.
MAVEN_OPTS & org.apache.maven.* properties appears to be the most universal way 
as the MAVEN_OPTS environment variable is generally also propagated 
automatically & some third party maven plugins can spawn child mvn instances 
thru intermediate programs or batch files which cannot be controled thru an 
API, or whatever you want.

I hope that I was able to clearly communicate the problem. being able to set 
such settings (settings, toolchain, ...) outside from the maven\conf dir will 
be great & help installations in complex environments to be more robust.

Really thx in advance
Best regards
Louis

> Return back org.apache.maven.user-settings and 
> org.apache.maven.global-settings properties
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-5199
>                 URL: https://issues.apache.org/jira/browse/MNG-5199
>             Project: Maven
>          Issue Type: New Feature
>          Components: Settings
>    Affects Versions: 3.0.3
>            Reporter: Karel Piwko
>
> According to discussion at 
> http://maven.40175.n5.nabble.com/Maven-3-support-for-org-apache-maven-user-settings-td3261146.html,
>  I'm sure there is a valid use case for the property:
> Imagine following:
> {code}
> mvn -s setting.xml test 
> {code}
> Surefire has no way how to pass the path of the settings.xml in the spawned 
> process. If the test in spawned process want to for example access remote 
> repository defined in settings.xml, user has to specify settings.xml path in 
> the test itself.
> However, for the following:
> {code}
> mvn -Dorg.apache.maven.user-settings=settings.xml test
> {code}
> This system property can be passed to surefire configuration and propagated 
> to the Surefire spawned process later on.
> Having a system property removes duplication of the environment settings.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to