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?
The following does the trick:
gradle init --type java-library
The task is provided by the init plugin
I achieved this kind of scaffolding using an init script. Have a look at my blog post about it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With