Gradle – Passing on the App Home Directory

Gradle’s ‘application’ plugin is cool enough to create start scripts for *nix and Windows platforms but doesn’t have an easy way pass on the app directory ( install path ). Knowing where your app is installed is pretty useful if you are writing for the desktop.

Here’s one hacky way to pass it on as a system property:

Reference – http://stackoverflow.com/a/25240099/206292

Always Use a Build Tool

Just started work on a personal project to learn some new frameworks and decided on using Spring + Jetty + MongoDB. I somehow managed to get Spring + Jetty working by going through some tutorials online but got stuck when it came to integrating MongoDB.

The most difficult task was resolving all the dependent jars. Most tutorials used maven to resolve dependencies but I didn’t use it as the XML style configuration was quite intimidating for me and so went out to resolve all dependencies manually by searching online and downloading them one by one as and when I encountered the NoClassDefFoundError, little did I know that this would be futile. After wasting several hours, got really frustrated and gave a shot at Gradle.

Oh boy! what a really elegant build tool after all .. this is all it took to resolve the dependencies