一、在项目中引入springboot有两种方式:
1、引入spring-boot-starter-parent
要覆盖parent自带的jar的版本号有两种方式:
(1)在pom中重新引入这个jar,然后版本不一样,新引入的会覆盖parent本身的版本。
(2)在<properties>中添加版本号变量
比如我们要修改mysql的版本号:
pom中也要加这个depency,只是版本号写在properties中了。
2、引入spring-boot-dependencies
depencies中如何覆盖依赖呢?
这里采用properties的这种方式不行,只能通过上面的第一种方式才可起作用:
二、springboot的内嵌容器
目前,springboot支持Tomcat,Jetty和Undertow作为Spring Boot嵌入式服务器,而Wiremock本身对特定版本的Jetty(目前为9.2)具有“本机”支持。要使用本地Jetty,您需要添加本机线程依赖关系,并排除Spring Boot容器(如果有的话)。
1、引入tomcat容器:直接引入spring-boot-starter-web,即引入了tomcat容器,默认为tomcat
2、引入jetty容器。添加spring-boot-starter-jetty,并移除starter-tomcat