问题
I want to download my dependencies to a specific folder in my build as part of my build process e.g. build/lib . I can't find documentation which shows how to do this, I'm sure there is a straightforward way to do it that I'm missing. My current(shortened) build.gradle is the following. The project compiles and executes test correctly.
apply plugin: 'java'
apply plugin: 'maven-publish'
repositories {
mavenCentral()
}
dependencies {
compile(
'aopalliance:aopalliance:1.0',
'log4j:log4j:1.2.17',
'batik:batik-svg-dom:1.6-1')
}
}
回答1:
I dont know if you tried this, but see if this works
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.runtime
}
build.dependsOn copyToLib
It worked for me.
Credit where its due :-) : http://forums.gradle.org/gradle/topics/how_can_i_gather_all_my_projects_dependencies_into_a_folder
来源:https://stackoverflow.com/questions/19385451/how-do-i-download-my-gradle-project-external-dependencies-to-a-specific-folder