Using gradle templates plugin

After some migrations from ant to Gradle and some green field projects I choose Gradle as my preferred build tool, but I missed something like the archetype target of maven.
After digging through the 3rd Party Plugins Page of Gradles Wiki I stumbled upon the Templates Plugin. It seems to me like a ideal approach for filling this gap between Gradle and Maven.

Ok, now my first installation of a third party plugin began and I stocked immediately. The way Eric Berry described for installing the plugin won’t work and as an additional drawback I don’t want to add this script to a basic build script in my toplevel development folder.

But first steps (getting it running) for the next ones.

After crawling through google I found this article written by Trương Xuân Tính.
As he describes I added the file templates.gradle to my <USER>/.gradle/init.d folder and inserted the prebuild apply from code fragment.
But, surprise surprise, I dosn’t work. But as I accidentally opened the URL

http://launchpad.net/gradle-templates/trunk/latest/+download/apply.groovy 

I figured out that launchpad redirects this link to

https://launchpadlibrarian.net/86359418/apply.groovy.

That was a surprise. It seems as if Gradle can’t or won’t handle that redirection (may for security reasons), but without any notification (that’s a pitty).
Now I changed the URL to the redirected one and, yes really, the templates plugin works as expected.

My further plans for are, that I would like to extend it first for my company to have a little bit more comfort and options and after that publishing the fork on git hub.

Cheers,
Peter

 
1 Kudos
Don't
move!

Leave a Reply

Your email address will not be published. Required fields are marked *