[ 
http://jira.codehaus.org/browse/MNG-2577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_100862
 ] 

John Casey edited comment on MNG-2577 at 6/29/07 8:46 AM:
----------------------------------------------------------

For all intents and purposes, "request properties" can be interpreted as 
"system properties."

This change introduces the ability to interpolate system properties inside the 
settings.xml, including in <server/> and other sections that don't get injected 
into the POM. This gives you the ability to do something like this:

{noformat}
<settings>
  <servers>
    <server>
      <id>myserver</id>
      <username>${user.name}</username>
    </server>
  </servers>
</settings>
{noformat}


What I have NOT allowed is the following:

{noformat}
<settings>
  <servers>
    <server>
      <id>myserver</id>
      <username>${someUser}</username>
    </server>
  </servers>

  <profiles>
    <profile>
      <id>p1</id>
      <activation>
        <property>
          <name>someUser</name>
          <value>me</value>
        </property>
      </activation>

      <properties>
        <someUser>otherGuy</someUser>
      </properties>
    </profile>

    <profile>
      <id>p2</id>

      <properties>
        <someUser>me</someUser>
      </properties>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>p2</activeProfile>
  </activeProfiles>
</settings>
{noformat}

If we allowed properties defined in profiles that were activated in the 
settings.xml to be sources for interpolating the rest of the settings.xml, the 
above example becomes very difficult to understand. What value will the server 
entry get: me or otherGuy? Will profile p1 be activated?


 was:
For all intents and purposes, "request properties" can be interpreted as 
"system properties."

This change introduces the ability to interpolate system properties inside the 
settings.xml, including in <server/> and other sections that don't get injected 
into the POM. This gives you the ability to do something like this:

{code:xml}
<settings>
  <servers>
    <server>
      <id>myserver</id>
      <username>${user.name}</username>
    </server>
  </servers>
</settings>
{code}


What I have NOT allowed is the following:

{code:xml}
<settings>
  <servers>
    <server>
      <id>myserver</id>
      <username>${someUser}</username>
    </server>
  </servers>

  <profiles>
    <profile>
      <id>p1</id>
      <activation>
        <property>
          <name>someUser</name>
          <value>me</value>
        </property>
      </activation>

      <properties>
        <someUser>otherGuy</someUser>
      </properties>
    </profile>

    <profile>
      <id>p2</id>

      <properties>
        <someUser>me</someUser>
      </properties>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>p2</activeProfile>
  </activeProfiles>
</settings>
{code}

If we allowed properties defined in profiles that were activated in the 
settings.xml to be sources for interpolating the rest of the settings.xml, the 
above example becomes very difficult to understand. What value will the server 
entry get: me or otherGuy? Will profile p1 be activated?

> Allow interpolation of Properties in settings.xml
> -------------------------------------------------
>
>                 Key: MNG-2577
>                 URL: http://jira.codehaus.org/browse/MNG-2577
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Settings
>    Affects Versions: 2.0.4, 2.0.5
>            Reporter: Michael Locher
>            Assignee: John Casey
>            Priority: Critical
>             Fix For: 2.1-alpha-1
>
>         Attachments: DefaultMavenSettingsBuilder.java.diff
>
>
> the attached patch (against 2.0.4) allows interpolation of system properties 
> into the .m2/settings.xml
> and interpolation of system properties and the properties of profiles found 
> in .m2/settings.xml (if they are activeByDefault) into conf/settings.xml
> these features are necessary in order to propagate user account settings 
> defined in user-specific .m2/settings.xml into server sections of the 
> institution-wide conf/settings.xml

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to