- 如果一个依赖写在了 parent 中,如:easyexcel,使用下方代码排除不了:
<parent> <groupId>cn.com.xuxiaowei.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.6.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <dependencies> <dependency> <groupId>cn.com.xuxiaowei.boot</groupId> <artifactId>spring-boot-starter</artifactId> <version>1.5.6.RELEASE</version> <exclusions> <exclusion> <groupId>com.alibaba</groupId> <artifactId>easyexcel</artifactId> </exclusion> </exclusions> </dependency> </dependencies>
- 可将代码 pom.xml 改为(删除原来的 parent,改为 dependencyManagement 引入):
<dependencies> <dependency> <groupId>cn.com.xuxiaowei.boot</groupId> <artifactId>spring-boot-starter</artifactId> <version>1.5.6.RELEASE</version> <exclusions> <exclusion> <groupId>com.alibaba</groupId> <artifactId>easyexcel</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>cn.com.xuxiaowei.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.6.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
07-01
1973

09-26
05-09
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交