springboot项目需要在pom文件中添加一下几行:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.3.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
.......
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
..........
</dependencies>
配置后,由于我的项目中还有其他的依赖,导致和springboot冲突,运行mvn dependency :tree可以查看依赖的jar包,使用<exclusion></exclusion>去除冲突jar包
然后启动springboot的时候报初始化内置tomcat出错,经查找发现项目中引用了servlet的jar包,去掉servlet依赖。
本文介绍如何在Spring Boot项目中解决依赖冲突问题,包括通过在pom.xml中配置排除特定jar包来避免与Spring Boot内置组件冲突的方法。

108

被折叠的 条评论
为什么被折叠?



