什么是'spring-boot-starter`罐子? [英] What are `spring-boot-starter` jars?

查看:156
本文介绍了什么是'spring-boot-starter`罐子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Spring Boot中,有一些关于 spring-boot-starter 模式的jar。所有这些罐子都不包含任何包装。它们的用途是什么?

In Spring Boot, there are some jars on the pattern of spring-boot-starter. All these jars do not contain any packages. What is their use?

在Maven POM中,添加了以下依赖项:

In Maven POMs, the following dependencies are added:


  • org.springframework.boot:spring-boot-starter-web

  • org.springframework.boot:spring-boot-starter-actuator

  • org.springframework.boot:spring-boot-starter-security

我实际需要使用哪些Spring Boot jar来实现这些功能罐子?我的项目没有任何依赖管理。我的项目是使用Spring Security的Spring MVC应用程序。

Which Spring Boot jars do I actually need to use the functionality in these jars? My project does not have any dependency management. My project is a Spring MVC application which uses Spring Security.

推荐答案

这些依赖项旨在为广告提供统一的条目。具有所有所需依赖项的临时框架项目。

Those dependencies are meant to provide a unified entry to an ad-hoc skeleton project with all needed dependencies.

它们通常应从项目描述符继承( pom.xml )这样您就可以获得所有已配置版本的父级依赖项。在开发人员方面没有更多的负担:

They should usually be inherited from your project descriptor (pom.xml) so that you get all parent dependecies with configured versions. No more burden to be done on the developer side:


Starter POM是一组方便的依赖描述符,可以包含在您的应用程序中。您可以获得所需的所有Spring和相关技术的一站式服务,而无需搜索示例代码并复制粘贴的依赖描述符。例如,如果您想开始使用Spring和JPA进行数据库访问,只需在项目中包含spring-boot-starter-data-jpa依赖项,您就可以开始使用了。

Starter POMs are a set of convenient dependency descriptors that you can include in your application. You get a one-stop-shop for all the Spring and related technology that you need, without having to hunt through sample code and copy paste loads of dependency descriptors. For example, if you want to get started using Spring and JPA for database access, just include the spring-boot-starter-data-jpa dependency in your project, and you are good to go.

参考, Spring Boot Starter POM

这些POM可用于合成可用于某种项目的依赖项,例如对于一个简单的Spring MVC项目,将包含以下工件(从 spring-boot-starter 读取, spring-boot-starter-web spring- boot-starter-security 分别):

Those POMs can be used to synthesize the dependencies that can be used for a certain kind of project, e.g. for a simple Spring MVC project, the following artifacts are to be included (Read from spring-boot-starter, spring-boot-starter-web, spring-boot-starter-security respectively):


  • Spring Boot工件:


    • org.springframework.boot:spring-boot

    • org.springframework.boot:spring-boot-autoconfigure

    • org.springframework.boot:spring-boot-starter-logging

    • Spring Boot artifacts:
      • org.springframework.boot:spring-boot
      • org.springframework.boot:spring-boot-autoconfigure
      • org.springframework.boot:spring-boot-starter-logging

      • org.springframework:spring-core

      • org.springframework:spring-web

      • org.springframework:spring-webmvc

      • org.springframework:spring-beans

      • org.springframework:spring-context

      • org.springframework:spring-expression

      • org.springframework:spring-aop

      • org.springframework.securi ty:spring-security-config

      • org.springframework.security:spring-security-web

      • org.hibernate:hibernate-validator

      • com.fasterxml.jackson.core:jackson-databind

      • org.springframework:spring-core
      • org.springframework:spring-web
      • org.springframework:spring-webmvc
      • org.springframework:spring-beans
      • org.springframework:spring-context
      • org.springframework:spring-expression
      • org.springframework:spring-aop
      • org.springframework.security:spring-security-config
      • org.springframework.security:spring-security-web
      • org.hibernate:hibernate-validator
      • com.fasterxml.jackson.core:jackson-databind

      可以在 maven中央存储库

      请注意,这可能不是一个完整的参考列表,因为某些组件可能正在消失因此,工件可能会更新。

      这篇关于什么是'spring-boot-starter`罐子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆