首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >分级5- windows java.io.IOException: CreateProcess error=206,文件名太长

分级5- windows java.io.IOException: CreateProcess error=206,文件名太长
EN

Stack Overflow用户
提问于 2018-12-01 09:53:05
回答 3查看 648关注 0票数 2

最初,gradle windows java.io.IOException: CreateProcess error=206, filename is too long是一个很好的解决方案。然而,对于第5级:

代码语言:javascript
复制
CollectionUtils.join(File.pathSeparator, classpath.getFiles())

失败与

代码语言:javascript
复制
 unknown property 'CollectionUtils' type org.gradle.api.tasks.testing.Test

什么是适合于gradle 5.0的修复方法?

至少对我来说:https://github.com/viswaramamoorthy/gradle-util-plugins/也失败了,在gradle 5.0上也有相同的错误

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2018-12-01 13:22:14

看起来经过一些调整后就能工作了

代码语言:javascript
复制
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 }
            }
        }
票数 0
EN

Stack Overflow用户

发布于 2018-12-01 11:39:50

您可以在gradle buildscript中使用外部库。

示例:

代码语言:javascript
复制
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)

我不确定这是否能解决您的问题,但是您也可以尝试其他类似的库。

票数 1
EN

Stack Overflow用户

发布于 2020-06-04 15:45:52

下面是用于build.gradle文件的内容。

代码语言:javascript
复制
buildscript {
    dependencies {
        classpath "gradle.plugin.ua.eshepelyuk:ManifestClasspath:1.0.0"
    }
}

apply plugin: "ua.eshepelyuk.ManifestClasspath"`
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53569601

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档