二、初步认识springBoot的pom.xml

1.  大体结构

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.3.RELEASE</version>            (springBoot项目的依赖版本)
    <relativePath/> <!-- lookup parent from repository -->
  </parent>

  <groupId>MySpringBootDemo</groupId>            (groupId:   项目或者组织的唯一标志)
  <artifactId>MySpringBootDemo</artifactId>           (artifactId:  项目的通用名称)
  <version>0.0.1-SNAPSHOT</version>              (version:   项目的版本)
  <name>MySpringBootDemo</name>              (name:     用户描述项目的名称,可选)
  <description>对于项目的简单描述</description>

  <properties>                         (properties:  定义一些常量,在pom中的其它地方可以直接引用。)
    <java.version>1.8</java.version>
  </properties>

  <dependencies>                        (dependencies:  依赖的jar包)
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

  </dependencies>

  <build>                            (build:  提供编译插件)

    <finalName>打包后的项目名字</finalName>         (finalName:打包后的项目名字)
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

</project>

2.个人见解

1)springBoot的依赖版本会影响下方导入的依赖jar包,springBoot相关依赖jar包不需要版本号

2)依赖jar包同maven项目,一般用maven中央仓库    -     https://mvnrepository.com/tags/maven

3)当导入的包保措,可能的原因:  包冲突(寻找替代包)  ;  下载的包有错误 (去个人本地仓库删包重新下载)

原文地址:https://www.cnblogs.com/y369/p/10643979.html