我有引用了很多JAR的buildscript块:
buildscript {
dependencies { classpath "com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13" }
dependencies { classpath "com.eriwen:gradle-css-plugin:2.14.0" }
dependencies { classpath "com.eriwen:gradle-js-plugin:2.14.1" }
dependencies { classpath "com.google.javascript:closure-compiler:v20160208" }
dependencies { classpath "org.akhikhl.gretty:gretty:+" }
}
task copyWarGradlePlugins(type: Copy) {
destinationDir = file(project.buildDir.name + '/warGradlePlugins')
from (buildscript.configurations.classpath)
}我想复制(到我的WAR文件)一些引用的WAR(例如gradle-css-plugin,gradle-js-plugin的依赖项,闭包编译器),而不是其他的(例如gretty,jmeter gradle-plugin)。
例如,我如何排除jmeter gradle-plugin及其所有依赖项?
更新:
这里有150+罐子。按文件名排除它们是不实际的,也是不可维护的。
发布于 2017-04-25 01:27:57
buildscript {
dependencies { classpath "com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13" }
dependencies { classpath "com.eriwen:gradle-css-plugin:2.14.0" }
dependencies { classpath "com.eriwen:gradle-js-plugin:2.14.1" }
dependencies { classpath "com.google.javascript:closure-compiler:v20160208" }
dependencies { classpath "org.akhikhl.gretty:gretty:+" }
}
task copyWarGradlePlugins(type: Copy) { copy ->
destinationDir = file(project.buildDir.name + '/warGradlePlugins')
copy.from(buildscript.configurations.classpath) { copySpec ->
// exclusions are based on the file name as here you will be handed
// DefaultFileVisitDetails type
copySpec.exclude { it.name.startsWith 'gretty' }
copySpec.exclude { it.name.startsWith 'closure-compiler' }
}
}https://stackoverflow.com/questions/43592915
复制相似问题