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:
-
boot new
命令会克隆一个外部项目,并且可选地对包进行重构以将其改成您选择的包名称。您还可以选择指定新项目的组 ID、工件 ID 和版本。 -
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. -
boot add
命令会将一个外部项目合并至您的当前项目。它会对项目依赖项、插件、注解和应用程序配置文件进行智能合并。它还会按照您当前项目的包结构对外部项目代码进行重构。 -
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. -
由用户提供的
commands
提供了一种友好的方法来对自定义命令进行定义和运行,这些命令可以在您的项目上执行日常任务。通过与您的代码一同存在声明命令定义,您可以轻松创建新的控制器,添加依赖项或配置文件。您也可以根据需要运行其他命令行应用程序,创建类似于 GitHub Action 客户端侧的体验。 -
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.