Spring CLI
-
boot new:克隆外部项目并进行可选的包重构。
-
boot add:合并外部项目,智能合并依赖项、插件、注解和配置文件。
-
用户定义的命令:创建和运行自定义命令,执行日常开发任务。
-
遵循“普通旧 Java 项目”方法,实现标准项目集,包含“README.md”文件,以帮助团队成员快速上手。
Spring CLI 的目标是在创建新项目和将功能添加到现有项目时提高工作效率。它通过提供以下高级功能来做到这一点:
The goal of the Spring CLI is to increase your productivity when you create new projects and when you add functionality to existing projects. It does this by providing the following high-level features:
-
The
boot new
command clones an external project and optionally performs a package refactoring to your chosen package name. You can also optionally specify the new project’s group id, artifact id, and version. -
The
boot add
command merges an external project to your current project. It performs an intelligent merge of project dependencies, plug-ins, annotations, and application configuration files. It also refactors the external project code into your current project’s package structure. -
User-provided
commands
provide a user-friendly way to define and run custom commands that can perform everyday tasks on your project. With declarative command definitions living alongside your code, you can easily create new controllers, add dependencies, or configure files. You can also run other command-line applications as needed, creating a client-side GitHub Actions like experience.
遵循“普通旧 Java 项目”代码生成方法,在“boot new”和“boot add”命令中实现,使公司和其他开发人员组能够使用首选库和编码风格定义标准项目集。通过在这些项目中包含“README.md”文件,团队成员可以快速上手新库或编程方法。例如,运行“boot add jpa”不仅会向项目添加代码,还会将“README.md”文件重命名为“README-jpa.md”文件,以便轻松发现。
Following a "Plain Old Java Projects" approach to code generation, implemented in the boot new
and boot add
commands, lets companies and other groups of developers define a standard set of projects with preferred libraries and coding styles. By including a README.md
file in these projects, team members can quickly get started with new libraries or programming approaches. For instance, running boot add jpa
not only adds code to your project but also renames the README.md
file to README-jpa.md
file for easy discovery.
用户定义的命令非常适合重复编码任务。由于命令定义与你的代码共存,因此你的团队中的任何人都可以在无需创建、更新和发布其他构件或项目的情况下,贡献或改进现有命令。
User-defined commands are ideal for repetitive coding tasks. Since command definitions live alongside the your code, anyone on the your team can contribute or improve existing commands without the need to create, update, and publish additional artifacts or projects.