To answer my own question for groovy, I found this:
http://weblogs.java.net/blog/2009/08/10/getting-most-out-maven-settingsxml-file
which explains doing this:
def server = settings.servers.find{ it.id.equals('dbserver') }
But does anyone know how to do it in ant?
Thanks,
Ben
----- "Ben Tatham" <[email protected]> wrote:
> Hi,
>
> Is it possible to access a server username/password (even/especially when
> encrypted) from an Ant Mojo and/or antrun script?
>
> If you know how to do it from a Java Mojo, I would take that too.
>
> I would like to be able to use it to ssh to other servers where we have some
> cross-compilers installed, etc, and currently we are forcing our developers
> to set our own properties in settings.xml, which does not support encryption.
>
> I have tried things like this (following the pattern from
> http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide) , but of
> course, the server <id> must get in there somehow, I assume.
> ${settings.servers.id.username} ${settings.server.id.username} etc etc to no
> avail.
>
> Thanks,
> Ben