You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bartosz Kowalewski <ko...@gmail.com> on 2010/09/15 23:26:43 UTC
How to make ${settings.x} style properties work?
Hello,
According to the POM Reference website, it is possible to access
settings defined in the settings.xml file by using ${settings.x} style
properties. In my pom.xml I need to access proxy settings that are
required to properly configure HTTP proxy to be used by some Ant
(antrun) tasks. I found some examples on the Internet and tried using
Maven properties like: settings.activeProxy.port and
settings.activeProxy.host. However, antrun plugin complains that these
properties haven't been set. I thought that the way in which contents
of the settings.xml file should be accessed might have changed since
the examples with settings.activeProxy.* were created, so I tried
using:
- different versions of Maven (2.1.0, 2.2.1)
- different properties as the real path is not
settings->activeProxy->host, but settings->proxies->proxy->host; I
wanted to check if a simpler path (i.e. settings.localRepository =
settings->localRepository) works
Both experiments were unsuccessful :(
What am I doing wrong? Is it a general problem with accessing settings
defined in settings.xml or is antrun that only copies Maven project
properties and ignores Maven settings.xml properties? What's the
easiest way to access Maven proxy settings and use these with antrun?
Thanks a lot for help!
Bartek
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to make ${settings.x} style properties work?
Posted by Stephen Connolly <st...@gmail.com>.
http://ant.apache.org/manual/Tasks/xmlproperty.html
<project>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<configuration>
<tasks>
<xmlproperty file="${user.home}/.m2/settings.xml" prefix="settings"/>
there might be a better way that would interact with the mvn -s ____ cli
option but that should get you at least part way functional
On 15 September 2010 22:26, Bartosz Kowalewski <kowalewski.bartosz@gmail.com
> wrote:
> Hello,
>
> According to the POM Reference website, it is possible to access
> settings defined in the settings.xml file by using ${settings.x} style
> properties. In my pom.xml I need to access proxy settings that are
> required to properly configure HTTP proxy to be used by some Ant
> (antrun) tasks. I found some examples on the Internet and tried using
> Maven properties like: settings.activeProxy.port and
> settings.activeProxy.host. However, antrun plugin complains that these
> properties haven't been set. I thought that the way in which contents
> of the settings.xml file should be accessed might have changed since
> the examples with settings.activeProxy.* were created, so I tried
> using:
> - different versions of Maven (2.1.0, 2.2.1)
> - different properties as the real path is not
> settings->activeProxy->host, but settings->proxies->proxy->host; I
> wanted to check if a simpler path (i.e. settings.localRepository =
> settings->localRepository) works
> Both experiments were unsuccessful :(
>
> What am I doing wrong? Is it a general problem with accessing settings
> defined in settings.xml or is antrun that only copies Maven project
> properties and ignores Maven settings.xml properties? What's the
> easiest way to access Maven proxy settings and use these with antrun?
>
> Thanks a lot for help!
>
> Bartek
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>