Maven, Gradle and Ant for Java on the Raspberry Pi B+

This is something I had been meaning to create for ages, a lot of preparation, but I finally managed to create it:

Please accept YouTube cookies to play this video. By accepting you will be accessing content from YouTube, a service provided by an external third party.

YouTube privacy policy

If you accept this notice, your choice will be saved and the page will refresh.

Description:

Compiling more than one Java file and assembling into a run-able Jar can be time consuming and repetitive when you use the command line. In this screen cast I demonstrate and compare three build tools that allow you to automate this process. In addition each tool builds and runs the associated tests for extra confidence in the code.

The code used can be found on GitHub’s Gist –  gist.github.com/gjb2048/d9fcb4e33fddb6a60531  – there are lots of guides and documentation around that help you construct the build scripts. But I have attempted to keep the scripts used as minimal and understandable as possible.

When compiling Java programs in an IDE I use the automated tools to create the run-able JAR file.  This is great when you have an IDE but when you have to use the command line this becomes tricky and tedious, need automating.  This is really important if you want to create run-able JAR’s that comprise of many files.  After all, I did not want to go back to the big, monolithic one file solution.  So what tool to use?  I have used Ant in the past, am getting into Maven and Gradle, so which one is best?  I had to find out!