Apache Ant: How To Set Property When Initially Unset

Also: How To Flexibly Pass JVM parameters to Apache Ant Java (Runtime) Task

Apache Ant is an excellent Java based build & deployment system using XML configuration file. In Ant properties are extensively used to configure tasks, conditionally run targets and more. In short they are an intergral part of build system. My requirement was simple. I wanted to pass JVM arguments to the Java runtime. However sometime I wanted to invoke it without passing any special runtime arguments. Unfortunately jvmarg element doesn't like it when its value is an empty string or even a string with spaces. Finding no way to fool it, I then tried to find a way to set the property to something when it is initially not set (while invoking). This proved surprisingly hard to do. Here is an elegant (I think) solution I came up with. Full article (231 words) »

Apache Ant: How To Include Multiple Jar Files In A Single Jar File

Apache Ant is an excellent and popular Java based build system. It has several built-in commands (tasks in Ant lingo) one of which allows you to create Jar file from your existing class file and resources. What if you wanted to include not just class files but selective contents of other jar files too and make a single big jar file?

Ant provides an undocumented way to include the contents of multiple jar files within a single jar file.
Full article (180 words) »

How To Pass Command Line Arguments To Ant Task / Script

Ant is a popular, high quality Java based build and deployment tool from Apache Foundation. You can invoke Java programs in ant using the java task. Optionally you may want to pass it command line arguments. Here is how you can do it.

Full article (89 words) »

Protected by Comment Guard Pro