The Power of Ant (Build System)

I am using Ant (Java based build system) for our project. Ant is an exceptionally powerful build system and should be the only build system you will ever need. You don't really need code monsters like Maven (or pile of …. as Bileblogger loves to say). With little effort here's what I achieved in few hours (aside from the obvious capability of compiling, running, building jar files etc.): Full article (498 words) »

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) »

Live Blogging from JavaOne Conference 6-9 May in San Francisco

Java OneI got an invitation for covering JavaOne and received a Press pass for the conference.

I am planning to attend the conference from 6-9 May in San Francisco and live blog about the event. I will be updating soon on the sessions I plan to attend and more.

Looking forward to meet some old friends in San Francisco during my stay.
Let me know if you are planning to attend too…

How Crappy Is Your Java Source Code?

How crappy is your Java code? Often we find others code crappier than ours, especially if we are given to maintain their code. Crappy code authors are almost always happy with their code quality. Can we quantify crappiness?

Full article (340 words) »

Protected by Comment Guard Pro