<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> </dependencies>
答:这就是SpringBoot自动配置的强大魅力。在咱们建立一个SpringBoot项目的时候,咱们的项目其实都会继承spring-boot-starter-parent项目,这是SpringBoot提供的一个启动器父级工程,在这个项目里面SpringBoot对全部可能用到的组件的版本号进行了统一管理。web
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.5.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
你不再用担忧使用某个组件会不会产生冲突问题了。SpringBoot说:一切都有我!spring