You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2018/12/30 16:35:12 UTC

[maven] 01/01: [MNG-6401] Proxy.active & port to String to support interpolation

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MNG-6401-2
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 0fb40ce55bf4de7ec98a55bd5fb9ff3a92298a19
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Mon May 21 23:29:15 2018 +0200

    [MNG-6401] Proxy.active & port to String to support interpolation
---
 maven-settings/src/main/mdo/settings.mdo | 43 ++++++++++++++++++++++++++++----
 1 file changed, 38 insertions(+), 5 deletions(-)

diff --git a/maven-settings/src/main/mdo/settings.mdo b/maven-settings/src/main/mdo/settings.mdo
index 333d8bd..b5b4021 100644
--- a/maven-settings/src/main/mdo/settings.mdo
+++ b/maven-settings/src/main/mdo/settings.mdo
@@ -423,6 +423,9 @@
       <description>
         <![CDATA[
         The <code>&lt;proxy&gt;</code> element contains informations required to a proxy settings.
+        Note: While the type
+        of this field is <code>String</code> for technical reasons, the semantic type is actually
+        <code>Boolean</code>. Default value is <code>true</code>.
         ]]></description>
       <fields>
         <field>
@@ -435,7 +438,7 @@
             Whether this proxy configuration is the active one.
             ]]>
           </description>
-          <type>boolean</type>
+          <type>String</type>
         </field>
         <field>
           <name>protocol</name>
@@ -468,15 +471,17 @@
           </description>
           <type>String</type>
         </field>
-        <field>
-          <name>port</name>
+        <field xml.tagName="port">
+          <name>portString</name>
           <version>1.0.0+</version>
           <description>
             <![CDATA[
-            The proxy port.
+            The proxy port. Note: While the type
+            of this field is <code>String</code> for technical reasons, the semantic type is actually
+            <code>integer</code>.
             ]]>
           </description>
-          <type>int</type>
+          <type>String</type>
           <defaultValue>8080</defaultValue>
         </field>
         <field>
@@ -501,6 +506,34 @@
           <type>String</type>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code>
+            <![CDATA[
+    public boolean isActive()
+    {
+        return ( active != null ) ? Boolean.parseBoolean( active ) : true;
+    }
+
+    public void setActive( boolean active )
+    {
+        this.active = String.valueOf( active );
+    }
+
+    public int getPort()
+    {
+        return ( portString != null ) ? Integer.parseInt( portString ) : 0;
+    }
+
+    public void setPort( int port )
+    {
+        this.portString = String.valueOf( port );
+    }
+            ]]>
+          </code>
+        </codeSegment>
+      </codeSegments>
     </class>
     <class>
       <name>Server</name>