commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <>
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 <>
> 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

anyone know?
> - robert


> To unsubscribe, e-mail:
> For additional commands, e-mail:

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