I am starting on spring boot
and used Spring boot inititlizr, and I see parent pom to be included, for example:
(我开始使用Spring spring boot
并使用了Spring Boot inititlizr,并且看到包括父pom,例如:)
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.10.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
I then wanted to have Spring web
, and the following got added:
(然后,我想拥有Spring web
,并添加了以下内容:)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
I have following questions:
(我有以下问题:)
Q1: Is it mandatory for every spring boot application to have spring-boot-starter-parent
as its parent pom?
(问题1:每个spring boot应用程序是否必须将spring-boot-starter-parent
作为其父pom?)
How about the situations in which we have multi-module projects? (我们拥有多模块项目的情况如何?)
Q2: For specific type of project, for example, Spring MVC / Sprint REST
, it added spring-boot-starter-web
.
(问题2:对于特定类型的项目,例如Spring MVC / Sprint REST
,它添加了spring-boot-starter-web
。)
So did this added the real dependencies for it? (那么这是否增加了真正的依赖关系呢?)
If so, then why we need spring-boot-starter-parent
to begin with? (如果是这样,那为什么我们需要spring-boot-starter-parent
呢?)
ask by CuriousMind translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…