最初,gradle windows java.io.IOException: CreateProcess error=206, filename is too long是一个很好的解决方案。然而,对于第5级:
CollectionUtils.join(File.pathSeparator, classpath.getFiles())失败与
unknown property 'CollectionUtils' type org.gradle.api.tasks.testing.Test什么是适合于gradle 5.0的修复方法?
至少对我来说:https://github.com/viswaramamoorthy/gradle-util-plugins/也失败了,在gradle 5.0上也有相同的错误
发布于 2018-12-01 13:22:14
看起来经过一些调整后就能工作了
doFirst {
if (org.apache.commons.lang.SystemUtils.IS_OS_WINDOWS) {
def cp = org.gradle.util.CollectionUtils.join(File.pathSeparator, classpath.getFiles())
environment 'CLASSPATH', cp
classpath = classpath.filter { false }
}
}发布于 2018-12-01 11:39:50
您可以在gradle buildscript中使用外部库。
示例:
buildscript {
repositories {
mavenCentral()
}
dependencies {
// this dependency will be used in gradle build script.
classpath 'org.apache.commons:commons-lang3:3.8.1'
}
}
//and use it like this in Your tasks
org.apache.commons.lang3.StringUtils.join(configurations.testRuntime,File.pathSeparator)我不确定这是否能解决您的问题,但是您也可以尝试其他类似的库。
发布于 2020-06-04 15:45:52
下面是用于build.gradle文件的内容。
buildscript {
dependencies {
classpath "gradle.plugin.ua.eshepelyuk:ManifestClasspath:1.0.0"
}
}
apply plugin: "ua.eshepelyuk.ManifestClasspath"`https://stackoverflow.com/questions/53569601
复制相似问题