Gradle has great scafolding capabilities for quickly bringing up a multi-module setup. There are few gaps here:
appis not a spring-boot based application.- Adding more than two
libraryorapiproject. - The names of the
library,apiandappprojects/modules are not configurable
The SpringInitializr helps in generating springboot based application with all the dependencies you need. In a way addresses the first issues but then how would add this generated app to existing build chain.
This plugin bridges the gap by enabling you to leverage multi-module setup capability of gralde with springboot based applications. You can declare the names of your library/api and application projects and the generator will scafold the code generated by gradle. In case of an application it adds basic @SpringbootApplication annotation to the main class.
This plugin also utilizes Gradle's buildSrc conventions and appropriately scafolds library and application project's build.gradle files.
First, install Yeoman and generator-gradle-springboot using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-gradle-springbootThen generate your new project:
yo gradle-springboot- Yeoman has a heart of gold.
- Yeoman is a person with feelings and opinions, but is very easy to work with.
- Yeoman can be too opinionated at times but is easily convinced not to be.
- Feel free to learn more about Yeoman.
Apache-2.0 © Amit Misra
