SpringBoot項目一般都會配置starter-parent依賴。
示例:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath/><!-- lookup parent from repository -->
</parent>
其主要作用:
- 指定編碼格式默認使用utf-8。
- 指定java版本默認使用1.8。
- 提供Dependency Management進行項目依賴的版本管理,如指定實際依賴的版本號(已經做版本兼容性測試)。
- 默認的資源過濾和插件管理。