springBoot之 spring-boot-starter-parent 引入详解

springBoot中引入

 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.1.RELEASE</version>
        <relativePath/>
  </parent>

相当于引入一个父类版本的jar库,在以后的

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

中可不写version版本,因为有父类会自动匹配。

注意:父类没有的jar版本,还是要

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>${mysql.version}</version>
</dependency>

样式引入

原文地址:https://www.cnblogs.com/qfdy123/p/13945374.html