Gradle, Jenkins, and executing uploadArchives only if build succeeds


What are people using for an idiom to do the following:

I execute “gradle clean build uploadArchives”, but I only want the uploadArchive task to execute if the build task succeeds.

Anybody? I found predicates here but am not sure how to elegantly use them in this case.

Thank you.

That’s the behavior you get in the first place.

Ohh. Thanks.