Creating projects with Gradle

Coming from a Maven background (Maven 1, 2, 3), I find it a bit strange that Gradle doesn’t provide archetypes like Maven does. There’s a template plugin, which helps a little, but besides that, you’re out of luck. Or are you?

I found a pretty neat Gradle script in their Jira system, which can create a directory structure for you even when working on a Groovy or Scala project. The easiest way to do so is to add the following ‘initProject’ task to the Gradle build.gradle:

You can call it by executing the following command:

This works great until Hans or Luke decide to create the

command, which would make our lives even easier!

3 replies
  1. Tomek
    Tomek says:

    hope they do add it at some point – it is useful

    BTW. I can remember the discussions about the usefulness of such thing since the beginnings of Gradle!

Trackbacks & Pingbacks

Comments are closed.