How to Copy dependencies to Build directory in Gra

2019-06-11 17:34发布

How to Copy dependencies to Build directory in Gradle without adding any tasks in build.gradle like mvn dependency:copy-dependencies..

1条回答
forever°为你锁心
2楼-- · 2019-06-11 18:02

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.

查看更多
登录 后发表回答