我希望能够从构建的 JAR 中排除AMAuthN.properties
文件。该文件一直出现在编译后 JAR 的根目录中。该文件位于项目文件夹根目录下的AMAuthN\src\main\resources\AMAuthN.properties
位置。谢谢!
apply plugin: 'java'
apply plugin: 'eclipse'
version = '1.0'
sourceCompatibility = 1.6
targetCompatibility = 1.6
test {
testLogging {
showStandardStreams = true
}
}
// Create a single Jar with all dependencies
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'com.axa.openam'
}
baseName = project.name
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
// Get dependencies from Maven central repository
repositories {
mavenCentral()
}
// Project dependencies
dependencies {
compile 'com.google.code.gson:gson:2.5'
testCompile 'junit:junit:4.12'
}
jar { exclude('thing1', 'thing2')}
。 - Camilo Silva