For the latest stable version, please use Spring Cli 0.9.0! |
Adding To Existing Projects
There are two methods for adding code to existing projects
-
Using the command
boot add
-
Using user-defined commands
Using the boot add command
The boot add command allows for intelligent merging of an existing project into the current project. The code of the existing project, located in a source code repository, is checked out into a temporary directory. The package structure of the existing project is then refactored to match the current project. Finally, all code and configuration are copied from the temporary location, creating new files or updating existing ones as necessary.
Using User-Defined commands
User-defined commands can be registered with the shell. Adding code or configuration to an existing project is accomplished through action files that contain instructions on what code or configuration needs to be generated and how it should be incorporated into the current project. The template engine used is Handlebars, which models the content of the code or configuration to be added to a new file or injected into an existing file. In addition, actions can execute shell actions, modify the Maven pom.xml file, and perform other tasks as needed.