Gradle引用本地文件并打包


需要引本地文件时在build.gradle文件中加入如下语句:

 compile files('src/main/resources/xxxx.jar')

 compile files('src/main/resources/')

必要的话需要打包时,在build.gradle文件中加入如下语句:

` def mainClassName = "" jar { manifest { attributes "Main-Class": "$mainClassName" }

from {
    configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}

}

`