Gradle在Spring项目中的任务

huangapple go评论75阅读模式
英文:

Gradle tasks in Spring project

问题

我在我的Eclipse Java Spring项目中找到了如下所示的Gradle任务:

application
  bootRun
build
  assemble
  bootBuildImage
...
build setup
documentation
help
ide
verification

这些任务是从哪里来的?它们是Gradle还是Spring的一部分?

英文:

I found gradle tasks shown below in my Eclipse Java Spring project:

application
  bootRun
build
  assemble
  bootBuildImage
...
build setup
documentation
help
ide
verification

Gradle在Spring项目中的任务
What these tasks are coming from? Is it part of Gradle or Spring?

答案1

得分: 0

它们看起来像是Gradle中的 assemblebuildbuildDependencies,无论你正在构建什么,这些都是标准的部分。

英文:

They look to be gradle as assemble, build, buildDependencies are all standard irrespective of what you are building.

答案2

得分: 0

(1) 你问

> 这些任务是从哪里来的?

Gradle 任务来自两个领域:Gradle 本身和 Gradle 插件。

例如,在包含文件 build.gradle 的文件夹中,(1a)当你运行命令

gradle bootRun

Spring Boot 应用程序运行时,通常会在 http://localhost:8080(默认)上运行并返回结果。gradle bootRun 成功运行是通过一个叫做 Spring-boot-gradle-plugin 的插件在 build.gradle 中声明而实现的。

(1b)当你运行

gradle wrapper

你的项目将添加一些文件夹和文件,使你的源代码变得可移植,在与同事分享时无需在本地计算机安装 Gradle。gradle wrapper 来自于 Gradle 本身,而不是来自第三方。

(2) 你问

> 这是属于 Gradle 还是 Spring 的一部分?

(1b)来自 Gradle 本身,(1a)是由 Spring 团队制作的插件。

参考链接:https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin

英文:

(1) You ask

> What these tasks are coming from?

Gradle task come from 2 area: by Gradle itself and by Gradle plug-ins.

For example, at folder where has file build.gradle , (1a) when you run command

gradle bootRun

Spring Boot application when run, it usually run and return result at http://localhost:8080 (default). gradle bootRun run success by an plugin called Spring-boot-gradle-plugin declared inside build.gradle .

(1b) When you run

gradle wrapper

your project will add some folder and files, make your source code become portable, no need install Gradle at local PC when you share for your colleagues. gradle wrapper come from Gradle itself, not from third-party one.

(2) You ask

> Is it part of Gradle or Spring?

(1b) from Gradle itself, (1a) is a plug-in made by Spring team.

Reference: https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin

huangapple
  • 本文由 发表于 2020年10月4日 17:23:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/64192959.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定