maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MNG-6401) Cannot interpolate property in proxy port of settings.xml
Date Wed, 02 May 2018 03:20:00 GMT

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

ASF GitHub Bot commented on MNG-6401:
-------------------------------------

jkatada opened a new pull request #163: [MNG-6401] - Cannot interpolate property in proxy
port of settings.xml
URL: https://github.com/apache/maven/pull/163
 
 
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed

          for the change (usually before you start working on it).  Trivial changes like typos
do not 
          require a JIRA issue.  Your pull request should address just this issue, without

          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line and body.
    - [x] Format the pull request title like `[MNG-XXX] - Fixes bug in ApproximateQuantiles`,
          where you replace `MNG-XXX` with the appropriate JIRA issue. Best practice
          is to use the JIRA issue title in the pull request title and in the first line of
the 
          commit message.
    - [x] Write a pull request description that is detailed enough to understand what the
pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will

          be performed on your pull request automatically.
    - [x] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if
you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache License Version
2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Cannot interpolate property in proxy port of settings.xml
> ---------------------------------------------------------
>
>                 Key: MNG-6401
>                 URL: https://issues.apache.org/jira/browse/MNG-6401
>             Project: Maven
>          Issue Type: Bug
>          Components: Bootstrap &amp; Build
>    Affects Versions: 3.0
>            Reporter: KATADA Junya
>            Priority: Minor
>
> If you use a property in proxy port of settings.xml, the property is not replaced and
the port number is "0" instead of property value.
> My minimal demo about this problem is [here|https://github.com/jkatada/maven-property-demo]. 
> In my demo, export two environment variables as follows.
> {quote}export MAVEN_PROXY_HOST_STRING=proxy.foo.com
> export MAVEN_PROXY_PORT_INT=18080
> {quote}
> These variables are used in settings.xml for proxy settings.
> {quote}<proxy>
>     <id>my_proxy</id>
>     <active>true</active>
>     <protocol>http</protocol>
>     <host>${env.MAVEN_PROXY_HOST_STRING}</host>
>     <port>${env.MAVEN_PROXY_PORT_INT}</port>
>     <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
>  </proxy>
> {quote}
> Execute maven-help-plugin to show effective settings.xml.
> {quote}mvn help:effective-settings -X
> {quote}
> The result is as follows.
> {quote}<proxy>
>     <port>0</port>
>     <host>proxy.foo.com</host>
>     <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
>     <id>my_proxy</id>
> </proxy>
> {quote}
>  
> `${env.MAVEN_PROXY_HOST_STRING}` is replaced with `proxy.foo.com`, 
> but `${env.MAVEN_PROXY_PORT_INT}` is not replaced with `18080`.
> I found the following WARNING message in console.
> {quote}[WARNING] Some problems were encountered while building the effective settings
> [WARNING] Unable to parse element 'port', must be an integer (position: END_TAG seen
...<port>${env.MAVEN_PROXY_PORT_INT}</port>... @12:47) caused by: java.lang.NumberFormatException:
For input string: "${env.MAVEN_PROXY_PORT_INT}" @ /root/.m2/settings.xml, line 12, column
47
> {quote}
> I think that the cause of this problem is to parse settings.xml before interpolation.
>  



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

Mime
View raw message