commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@apache.org>
Subject Re: [logging] anyone know an elegant way to switch on a system property using ant?
Date Wed, 01 Feb 2006 23:06:14 GMT
On 2/1/06, robert burrell donkin <robertburrelldonkin@blueyonder.co.uk>
wrote:
>
> i've been playing around with ways to persuade ant to switch JCL
> diagnostics on which means setting a system property. i know workarounds
> (like defining a trivial task, for example) but i'm sure that there must
> be an elegant way to do this which i just can't discover. since it's for
> some documentation, i'd prefer to suggest users do it the right way.


Is this in the context of running some JUnit tests?  If so, the <junit> task
accepts nested <sysproperty> elements to set system properties that are
passed in to the executing tests.  (IIRC you also have to say fork="true"
for this to work, because you won't want to mess with the JVM that Ant
itself is running in).

Programmatically, of course, you can call System.setProperty() if your
security manager lets you (or if you're not running under a security
manager).

anyone know?
>
> - robert


Craig

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message