From issues-return-132125-archive-asf-public=cust-asf.ponee.io@maven.apache.org Wed May 2 05:56:07 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id A1574180645 for ; Wed, 2 May 2018 05:56:06 +0200 (CEST) Received: (qmail 61120 invoked by uid 500); 2 May 2018 03:56:04 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 61109 invoked by uid 99); 2 May 2018 03:56:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 May 2018 03:56:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 326261A20E8 for ; Wed, 2 May 2018 03:56:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -102.311 X-Spam-Level: X-Spam-Status: No, score=-102.311 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id os3e5YzHhDu5 for ; Wed, 2 May 2018 03:56:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 9A00E5FB98 for ; Wed, 2 May 2018 03:56:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9A99EE0230 for ; Wed, 2 May 2018 03:56:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2D2E821296 for ; Wed, 2 May 2018 03:56:00 +0000 (UTC) Date: Wed, 2 May 2018 03:56:00 +0000 (UTC) From: "KATADA Junya (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MNG-6401) Cannot interpolate property in proxy port of settings.xml MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MNG-6401?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] KATADA Junya updated MNG-6401: ------------------------------ Description:=20 If you use a property in proxy port of settings.xml, the property is not re= placed and the port number is "0" instead of property value. My minimal demo about this problem is [here|https://github.com/jkatada/mave= n-property-demo].=C2=A0 In my demo, export two environment variables as follows. {code} export MAVEN_PROXY_HOST_STRING=3Dproxy.foo.com export MAVEN_PROXY_PORT_INT=3D18080 {code} These variables are used in settings.xml for proxy settings. {code:xml} =C2=A0 =C2=A0 my_proxy =C2=A0 =C2=A0 true =C2=A0 =C2=A0 http =C2=A0 =C2=A0 ${env.MAVEN_PROXY_HOST_STRING} =C2=A0 =C2=A0 ${env.MAVEN_PROXY_PORT_INT} =C2=A0 =C2=A0 local.net|some.host.com {code} Execute maven-help-plugin to show effective settings.xml. {code} mvn help:effective-settings -X {code} The result is as follows. {code:xml} =C2=A0 =C2=A0 0 =C2=A0 =C2=A0 proxy.foo.com =C2=A0 =C2=A0 local.net|some.host.com =C2=A0 =C2=A0 my_proxy =C2=A0{code} `*${env.MAVEN_PROXY_HOST_STRING}*` is replaced with `*proxy.foo.com*`,=20 but `*${env.MAVEN_PROXY_PORT_INT}*` is not replaced with `*18080*`. I found the following WARNING message in console. {code:java} [WARNING] Some problems were encountered while building the effective setti= ngs [WARNING] Unable to parse element 'port', must be an integer (position: END= _TAG seen ...${env.MAVEN_PROXY_PORT_INT}... @12:47) caused by:= java.lang.NumberFormatException: For input string: "${env.MAVEN_PROXY_PORT= _INT}" @ /root/.m2/settings.xml, line 12, column 47 {code} I think that the cause of this problem is to parse settings.xml before inte= rpolation. =C2=A0 was: If you use a property in proxy port of settings.xml, the property is not re= placed and the port number is "0" instead of property value. My minimal demo about this problem is [here|https://github.com/jkatada/mave= n-property-demo].=C2=A0 In my demo, export two environment variables as follows. {code:bash} export MAVEN_PROXY_HOST_STRING=3Dproxy.foo.com export MAVEN_PROXY_PORT_INT=3D18080 {code} These variables are used in settings.xml for proxy settings. {code:xml} =C2=A0 =C2=A0 my_proxy =C2=A0 =C2=A0 true =C2=A0 =C2=A0 http =C2=A0 =C2=A0 ${env.MAVEN_PROXY_HOST_STRING} =C2=A0 =C2=A0 ${env.MAVEN_PROXY_PORT_INT} =C2=A0 =C2=A0 local.net|some.host.com {code} Execute maven-help-plugin to show effective settings.xml. {code:bash} mvn help:effective-settings -X {code} The result is as follows. {code:xml} =C2=A0 =C2=A0 0 =C2=A0 =C2=A0 proxy.foo.com =C2=A0 =C2=A0 local.net|some.host.com =C2=A0 =C2=A0 my_proxy {code} =C2=A0 `${env.MAVEN_PROXY_HOST_STRING}` is replaced with `proxy.foo.com`,=20 but `${env.MAVEN_PROXY_PORT_INT}` is not replaced with `18080`. I found the following WARNING message in console. {code} [WARNING] Some problems were encountered while building the effective setti= ngs [WARNING] Unable to parse element 'port', must be an integer (position: END= _TAG seen ...${env.MAVEN_PROXY_PORT_INT}... @12:47) caused by:= java.lang.NumberFormatException: For input string: "${env.MAVEN_PROXY_PORT= _INT}" @ /root/.m2/settings.xml, line 12, column 47 {code} I think that the cause of this problem is to parse settings.xml before inte= rpolation. =C2=A0 > 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 & 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/ma= ven-property-demo].=C2=A0 > In my demo, export two environment variables as follows. > {code} > export MAVEN_PROXY_HOST_STRING=3Dproxy.foo.com > export MAVEN_PROXY_PORT_INT=3D18080 > {code} > These variables are used in settings.xml for proxy settings. > {code:xml} > > =C2=A0 =C2=A0 my_proxy > =C2=A0 =C2=A0 true > =C2=A0 =C2=A0 http > =C2=A0 =C2=A0 ${env.MAVEN_PROXY_HOST_STRING} > =C2=A0 =C2=A0 ${env.MAVEN_PROXY_PORT_INT} > =C2=A0 =C2=A0 local.net|some.host.com > > {code} > Execute maven-help-plugin to show effective settings.xml. > {code} > mvn help:effective-settings -X > {code} > The result is as follows. > {code:xml} > > =C2=A0 =C2=A0 0 > =C2=A0 =C2=A0 proxy.foo.com > =C2=A0 =C2=A0 local.net|some.host.com > =C2=A0 =C2=A0 my_proxy > > =C2=A0{code} > `*${env.MAVEN_PROXY_HOST_STRING}*` is replaced with `*proxy.foo.com*`,=20 > but `*${env.MAVEN_PROXY_PORT_INT}*` is not replaced with `*18080*`. > I found the following WARNING message in console. > {code:java} > [WARNING] Some problems were encountered while building the effective set= tings > [WARNING] Unable to parse element 'port', must be an integer (position: E= ND_TAG seen ...${env.MAVEN_PROXY_PORT_INT}... @12:47) caused b= y: java.lang.NumberFormatException: For input string: "${env.MAVEN_PROXY_PO= RT_INT}" @ /root/.m2/settings.xml, line 12, column 47 > {code} > I think that the cause of this problem is to parse settings.xml before in= terpolation. > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)