maven和gradle全局exclude jar包
更新:HHH   时间:2023-1-7


maven,在pom文件里

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.3</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<excludes>
						<exclude>commons-logging:commons-logging</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>

说是还有一种方法

<dependencies>
  <dependency>
      <artifactId>avalon-framework</artifactId>
      <groupId>avalon-framework</groupId>
      <version>4.1.3</version>
      <scope>provided</scope>
  </dependency></dependencies>

Gradle 在build.gradle文件里

configurations {
    compile.exclude module: 'commons-logging'
}

maven不太好用,上面两种不琮起作用.用gradle很方便,gradle的全局排除很有用.

返回开发技术教程...