SpringBoot 依赖管理

SpringBoot 依赖管理_第1张图片

Spring Boot 依赖管理

1. 父项目做依赖管理

无需关注版本号,自动版本仲裁机制


<parent>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-parentartifactId>
        <version>2.3.4.RELEASEversion>
parent>



 <parent>
    <groupId>org.springframework.bootgroupId>
    <artifactId>spring-boot-dependenciesartifactId>
    <version>2.3.4.RELEASEversion>
  parent>

2. 修改默认版本号



    <properties>
        <mysql.version>5.1.43mysql.version>
    properties>

3. starter 场景启动器


<dependencies>
    <dependency>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-webartifactId>
    dependency>
dependencies>





<dependency>
  <groupId>org.springframework.bootgroupId>
  <artifactId>spring-boot-starterartifactId>
  <version>2.3.4.RELEASEversion>
  <scope>compilescope>
dependency>

你可能感兴趣的:(SpringBoot,spring,boot,java,后端)