Firstly, I would suggest using the application plugin if you can, since it will take care of it already.
If you want to reset the file path yourself, the easiest way:
task writeClasspath << {
buildDir.mkdirs()
new File(buildDir, "classpath.txt").text = configurations.runtime.asPath + "\n"
}
If you want to copy all the libraries in the directory path, you can do:
task copyDependencies(type: Copy) {
from configurations.runtime
into new File(buildDir, "dependencies")
}
source
share