2
我在這裏做錯了什麼?最終目標是從URL下載* .properties。Gradle - 不能實例化常春藤類
【我知道解析器是不需要的,只是試着看看是否有類名問題。 ]
錯誤:
build file '/home/awm/t/build.gradle': 13: unable to resolve class org.apache.ivy.plugins.resolver.URLResolver
@ line 13, column 20.
def resolver = new org.apache.ivy.plugins.resolver.URLResolver()
^
build file '/home/awm/t/build.gradle': 14: unable to resolve class org.apache.ivy.util.url.ApacheURLLister
@ line 14, column 21.
def urlLister = new org.apache.ivy.util.url.ApacheURLLister()
^
代碼:
plugins {
id "de.undercouch.download" version "2.0.0"
}
import de.undercouch.gradle.tasks.download.Download
import org.apache.ivy.util.url.*
task downloadDirectory {
def dir = 'http://127.0.0.1:8081/artifactory/gradle-local/props/'
def resolver = new org.apache.ivy.plugins.resolver.URLResolver()
def urlLister = new org.apache.ivy.util.url.ApacheURLLister()
def files = urlLister.listFiles(new URL(dir))
download {
src files
dest "lib"
}
}
defaultTasks 'downloadDirectory'