Re: Passing system properties by default to java task

Stefan Bodewig <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
On 2017-08-17, Al Le wrote:

> How can I achieve that some system properties are passed to the JVM
> started by the 'java' task with the 'fork=true' option without
> specifying them explicitly in the script?

Setting clonevm to true will copy over all system properties - but a
bunch of other settings as well. Whether this is good enought for you is
unclear to me.

A nested

<syspropertyset>
  <propertyref builtin="system"/>
</syspropertyset>

will only copy the system properties.

As you say you are using similar <java> tasks several times during the
build it may be a good idea to <presetdef> a new task with all the
proper defaults already configured in.

Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.