Artifactory publish without assemble

I based my continues delivery pipeline on Peter Niederwieser’s presentation.

It makes sense and business is happy with this pipeline.

The difference between my pipeline and his is that my publish binaries goes to artifactory snapshot.
I then added a release manual task between the commit stage and the acceptance stage that moves the snapshot into the artifactory release repository.

For both these tasks I use the artifactoryPublish task. The problem with this task is it does the assemble task every time before publishing. This is not ideal because I want the same artifact in snapshot to be copied to the release repository.

Is there a way that I can stop the second artifactoryPublish task from doing the assemble again or is there another way of doing this?

I’d instead promote the artifact from the snapshot to the release repository. You can do so by making a call to the Artifactory API (see Build Promotion). Just wrap the call into a Gradle task. Done!

Build Promotion requires Artifactory Pro, I’m not working with pro.

In that case you might want to try to remove the assemble task dependency.

artifactoryPublish.dependsOn.remove('assemble')

I ended up excluding the tasks from the command line:

-x war -x ear -x jar