How to Copy dependencies to Build directory in Gradle without adding any tasks in build.gradle like mvn dependency:copy-dependencies..
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If you really don't want a task for this you could use the copy
method of the project
object.
configurations {
compile
}
dependencies {
compile 'someGroup:someArtifact:someVersion'
}
project.copy {
from project.configurations.compile
into project.buildDir
}
One noticeable effect of this is that the resolving will be triggered for every invokation i.e. even if you only want to list tasks the resolve and copy will be triggered.