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

Brett Randall commented on MNG-6310:
------------------------------------

Sorry, I must have missed the update and request-for-comment on this issue.

If I could phrase this another way: given a build environment (e.g. a mobile 
computer) which sometimes has direct, no-proxy internet access, and sometimes 
needs to go through a proxy-server - how can a build be started in either of 
these environments without having to hand-edit {{settings.xml}}?

Here's a good SO post which claims a solution but does not apply for current 
Maven releases at least: 
[https://stackoverflow.com/questions/39348487/is-it-possible-to-use-proxy-only-when-a-specific-profile-is-active-in-maven]
 .  
[https://stackoverflow.com/questions/2354001/make-maven-proxy-server-settings-configurable-based-on-location/34177273#34177273]
 offers another solution based on property-substitution of {{nonProxyHosts}}.

Perhaps ensuring a caching-MRM is always available provides a solution, but 
sometimes this is not practical in all, non-corporate environments.

> settings.xml allow proxy activation by expression
> -------------------------------------------------
>
>                 Key: MNG-6310
>                 URL: https://issues.apache.org/jira/browse/MNG-6310
>             Project: Maven
>          Issue Type: New Feature
>          Components: Bootstrap & Build
>    Affects Versions: 3.5.2
>            Reporter: Brett Randall
>            Priority: Minor
>
> Currently it appears that {{settings.xml}} proxies can only be activated via 
> a boolean {{active}} element, which does not appear to be evaluated, so you 
> cannot use a property (e.g. set by a profile), nor a system or environment 
> property.
> This comes up a lot on discussions from developers trying to automate whether 
> Maven's proxies are enabled or not, based on a system or environment property 
> etc.
> Possible solutions:
> * Change the model for (generate) {{Proxy.active}} allowing an expression to 
> then be evaluated.
> * Copy {{profiles}} approach and add an {{<activation>>}} element, but this 
> requires a settings schema rev.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to