# 概念

当 A 依赖 B,B 依赖 C 而且 C 可以传递到 A 的时候,A 不想要 C, 需要在 A 里面把 C 排除掉,而往往这种情况都是为了避免 jar 包之间的冲突

image-20240208132336524

所以配置依赖的排除其实就是阻止某些 jar 包的传递,因为这样的 jar 包传递过来会和其它 jar 包冲突

# 配置方式

<!-- 配置依赖的排除 -->
		<exclusions>
			<!-- 配置具体排除信息,让 commons-logging 不要传递到当前工程 (pro2-maven-web) -->
			<exclusion>
				<!-- 这里指定坐标时不需要指定 version -->
				<groupId>commons-logging</groupId>
				<artifactId>commons-logging</artifactId>
			</exclusion>
		</exclusions>

image-20240208132350411