且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“文件名或扩展名太长错误”使用gradle

更新时间:2021-12-04 02:36:17

我有类似的问题,在我的情况下这很好用:

I had similar problem, in my situation this works fine:

 task pathingJar(type: Jar) {
      dependsOn configurations.runtime
      appendix = 'pathing'

      doFirst {
         manifest {
             attributes "Class-Path": configurations.runtime.files.collect {it.toURL().toString().replaceFirst("file:/", '/')}.join(" ")
         }
     }
 }
 bootRun {
     dependsOn pathingJar
     doFirst {
         classpath = files("$buildDir/classes/main", "$buildDir/resources/main", pathingJar.archivePath)
     }
 }