I am a new Gradle user. My task is to build a Gradle based project and then copy the final jar along with its dependencies jars to a remote host.
My approach is to do a local build, and then copy dependencies jars from caches to a local directory with a gradle task, which looks like:
task copyDependencies(type: Copy) {
from configurations.runtime
into "build/libs/deps"
}
But this task copies all the dependencies, say including transitive dependencies to the target directory; moreover, the runtime group include compile dependencies by default. So I would like to exclude the transitive dependencies, which takes great amount of space and the compile time dependencies jars. Is there any solution?
At last I plan to copy the generated jar and dependencies jars to a remote host by means of ssh, but I guess there should a way to directly finish this by means of a gradle task
Faithfully hope someone can give some useful hint