在Maven中,排除依赖包的子依赖可以通过在pom.xml文件中使用
例如,假设要排除spring-boot-starter-web依赖包的子依赖中的spring-boot-starter-tomcat依赖,可以在pom.xml文件中添加以下配置:
org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat
在上述配置中,通过在spring-boot-starter-web依赖包上使用
保存pom.xml文件后,重新构建项目,Maven将会排除指定的子依赖。