Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scaffolding in Gradle

Tags:

java

gradle

Whenever I start a new Java+Gradle project, I create the following directory structure manually:

project-name
  |
  |--- build.gradle
  |
  |--- .gitignore
  |
  |--- src
        |--- main
        |      |---java
        |
        |--- test
               |---java

Since this is a fairly standard structure, I imagine there must be a plugin/command/task for Gradle that would do this scaffolding for me. Is there such a plugin/command/task available? If not, can I write a task for that?

like image 840
missingfaktor Avatar asked Mar 23 '13 11:03

missingfaktor


2 Answers

The following does the trick:

gradle init --type java-library

The task is provided by the init plugin

like image 173
Jan Schaefer Avatar answered Oct 21 '22 12:10

Jan Schaefer


I achieved this kind of scaffolding using an init script. Have a look at my blog post about it.

like image 44
erdi Avatar answered Oct 21 '22 12:10

erdi