Regarding uploading jars only when all subproject builds are successful, one option could be to declare an upload task in root project that has dependency on all subproject’s build tasks and takes the generated artifacts from each project and uploads.
I don’t have any problem while copying files with ssh/scp. But i need an help to copy a Jar file from ($build/lib/*.jar) to remote server if the build is success.
For eg I have three Projects(A:B:C)
if gradle build fails for Project(B), then I have to copy Project(A:C) jar to remote server…
I need to copy(subprojects.jar) task only in root dir(build.gradle). I don’t want to define the task in each project.I need to have globally only in root buld.gradle.
Any idea how we can achieve this…
The below is my copy Jar script
task copyJars(type: Copy, dependsOn: subprojects.jar) {
onlyIf { tasks.build.state == null }
from(subprojects.jar)
into project.file(‘dest’)
}
how i can integrate the above code to remote server ssh operation.My destination will be remote server.