首页 > 代码库 > maven和gradle全局exclude jar包

maven和gradle全局exclude jar包

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的全局排除很有用.

本文出自 “梦里不知身是客” 博客,转载请与作者联系!

maven和gradle全局exclude jar包