Spring Boot项目基础配置

  • 自定义打包方式
  1. 首先去除pom文件中的原有的parent
<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.2.2.RELEASE</version>
	<relativePath/>
</parent>
  1. 方便开发微服务项目或者多模块项目时如需要对项目依赖版本进行统一管理,就需要使用dependencyManagement来实现了。在原dependencies外层增加dependencyManagement标签,需注意的是,如果使用dependencyManagement来管理依赖,那么子项目中需声明父类项目中的依赖才能被使用,如果父项目中直接使用dependencies来管理依赖,那么所有基层此父项目的子项目将拥有父项目中的所有依赖。
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>2.0.5.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
  1. 因为去掉了spring-boot-starter-parent的继承,所以我们需要手动设置Java版本及编码格式等
//设置编码格式
<properties>
	
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值