我正在使用maven antrun插件,我正在尝试从我的war文件中排除库文件。但我无法做到。我知道它可以使用maven war插件完成,但希望它被排除在maven antrun之外。
group 'ch.wisv'
version '0.1'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
jar {
baseName = 'toornament-client'
version = '0.1'
}
dependencies {
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.7'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.8.7'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.7'
compile 'junit:junit:4.12'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile 'com.squareup.okhttp3:mockwebserver:3.6.0'
testCompile 'org.mockito:mockito-core:2.18.0'
}
答案 0 :(得分:2)
使用fileset指示库的排除jar
<fileset dir="/lib">
<exclude name="*.jar" />
</fileset>