为什么 spring-boot-starter 项目的 github 项目是空的?

why are the github projects of spring-boot-starter projects empty?

在查看 github 上的 spring-boot-starter-web, spring-boot-starter-security 项目时,我发现它们是空的,只有一个 build.gradle 文件。

我希望这符合预期,但这让我明白了在哪里可以找到实际的源代码。而且我使用 Maven,所以我期望在这些项目中至少有一个 pom.xml。但由于它不存在,我想知道 spring 引导团队如何将工件发布到 Maven 中央仓库。

I hope this is as expected

这符合预期。 Spring Boot 的起始模块的存在纯粹是为了将多个依赖项组合成一个方便的“包”。例如,如果您想要使用 Spring MVC 和 Tomcat 编写一个基于 Servlet 的 Web 应用程序,则对 spring-boot-starter-web 的单一依赖项提供了您需要的所有依赖项。您可以在 reference documentation.

中了解更多关于初学者的信息

Where the actual source code can be found

大部分代码可以在 spring-boot-autoconfigure. For more production-focused features, you'll also find some code in spring-boot-actuator-autoconfigure. The code in these two modules is activated automatically when the dependencies that it requires are on the classpath. You can learn more about this conditional activation and auto-configuration in the reference documentation 中找到。

And I use maven, so I was expecting atleast a pom.xml in these projects. But since it is not present, I am wondering how spring boot team publishes there artifacts to maven central repo.

Spring Boot 是使用 Gradle 构建的,与 Maven 不同,它完全分离了构建系统构建项目所需的配置和构建系统使用项目所需的信息。 build.gradle 文件提供了 Gradle 构建项目所需的所有信息。作为其中的一部分,它生成 Gradle 模块元数据文件和 Maven pom.xml 文件,其中包含分别使用 Gradle 和 Maven 使用项目所需的所有信息。然后将这些生成的文件与 jar 文件、源代码等一起发布到 Maven Central