Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java org.springframework.boot.spring-boot POM的用途是什么?_Java_Spring_Spring Boot_Maven - Fatal编程技术网

Java org.springframework.boot.spring-boot POM的用途是什么?

Java org.springframework.boot.spring-boot POM的用途是什么?,java,spring,spring-boot,maven,Java,Spring,Spring Boot,Maven,Sprint Bootorg.springframework.Boot.springboot 它包括 org.springframework.spring-core org.springframework.spring-context 所以像你这样的人 为什么不直接创建org.springframework.boot.springbootstarterweb org.springframework.spring-webmvc org.springframework.spring-core or

Sprint Boot
org.springframework.Boot.springboot

它包括

org.springframework.spring-core
org.springframework.spring-context
所以像你这样的人

为什么不直接创建
org.springframework.boot.springbootstarterweb

org.springframework.spring-webmvc
org.springframework.spring-core
org.springframework.spring-context    
org.springframework.boot.spring-boot-starter-json
org.springframework.boot.spring-boot-starter-tomcat

spring boot starter
具有以下依赖项:

jakarta.annotation-api
spring-core
spring-boot
spring-boot-autoconfigure
spring-boot-starter-logging
如果将
spring boot starter
替换为
spring core
spring context
,则会丢失
spring boot
spring boot autoconfigure
中定义的所有类和注释(
springboot
依赖于
springcore
springcontext
,但它本身实现了一些重要的类,见下文)

spring boot starter web
为例,通常我们需要在
应用程序.yml
中设置
server.port
,该属性在
spring boot autoconfigure
项目的类中定义(这就是为什么我们需要
spring boot starter
中的原因),还有其他常用属性,如
server.address
server.servlet.context path
,和
server.ssl.*
…等等。它们都在
spring boot autoconfigure
项目中定义

为了自动配置中定义的属性,将创建类作为参数,并应用其值来设置软件,如

现在请注意,它既没有使用
@Configuration
注释,也没有使用
@Component
注释,因此在进行组件扫描时它不会被实例化,因此创建此注释是为了确保的实例将被注入。此注释在
spring boot
项目中定义,这就是我们需要
spring boot
de的原因悬而未决。它被使用了


关于什么是spring boot starter以及它是如何工作的,这里有一篇有用的文章:

这就是我试图理解的-你遗漏了什么“重要的依赖项”?我在这里没有看到任何其他内容
jakarta.annotation-api
spring-core
spring-boot
spring-boot-autoconfigure
spring-boot-starter-logging