In this example, the java code does a simple thing - to send an email. We could have used the built in the Ant task to do that. However, now that you have got the idea, you can extend your build file to call the java code that performs complicated things, for example: encrypts your source code.