You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Kenney Westerhof (JIRA)" <ji...@codehaus.org> on 2005/09/21 17:06:11 UTC

[jira] Commented: (MNG-942) Ability to source system properties in settings.xml

    [ http://jira.codehaus.org/browse/MNG-942?page=comments#action_46843 ] 

Kenney Westerhof commented on MNG-942:
--------------------------------------

(I'm assuming that by 'source Java System properties' you mean setting them, like System.setProperty or -Dprop=val).

Most of this can be achieved using profiles in settings.xml:

- sourcing java system properties (a la -Dx=y ) can be done using profiles

- jvm args (-Xmx768m etc) cannot be in the settings.xml since the jvm has already
started then

- there's just one localRepository in the settings.xml; but you can override using
a maven option (-Dmaven.repo.local as you said, not sure if that works
in conjunction with profiles, because I don't know which one is set first, and
if it's read afterwards. But why the need for multiple local repositories? just use 
-s path/to/settings.xml)

- Switching proxy info: use a different settings.xml, specified with -s. Maybe
proxies should go in the profiles section too, so you can change them.


Reading your description for the fifth time, I suspect you meant using ${propname} 
in the settings.xml, which get filled in using -Dpropname=propval?

Could you clarify some more and/or say if the solutions above are good alternatives?
I think a nice one for roaming users is to have multiple settings.xml files,
and let the m2 script give a '-s ~/.m2/settings-$ENVIRONMENT.xml' to main().




> Ability to source system properties in settings.xml
> ---------------------------------------------------
>
>          Key: MNG-942
>          URL: http://jira.codehaus.org/browse/MNG-942
>      Project: Maven 2
>         Type: Wish
>     Versions: 2.0-beta-1
>  Environment: Maven 2.0-beta-1
> WIN XP PRO SP2
> java version "1.5.0_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)
>     Reporter: John Allen
>     Priority: Trivial

>
>
> Would be nice to be able to source Java System properties in the global and user settings.xml file. This is intended to allow custom build systems to set arbitrary m2 settings.xml properties programmatically by wrapping m2 executable in their own wrapper exe and then passing these settings to M2 via the JVM options ($MAVEN_OPTS). Currently only explicitly supported settings can be overrided/defined by system properties (such as maven.repo.local).
> An example might be the proxy being employed, depending on where the build is being run from the proxy might be set differently. Note the same machine is being used (a laptop in this case) but operates in multiple locations and therefore network configurations (work/home). The M2 wrapping script can detect this difference from network info (ipconfig or IE connection details) and set the proxy details appropriately. I guess in this example it would be even better if it was just able to set a System property that acted as a switch which then activated the correct proxy configuration defined in 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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org