Pushing artifacts at the end of the pipeline or as soon they are produced


My CI/CD Jenkins pipeline produces java artifacts and docker images.

I would like to know what are the advantages or disadvantages of pushing artifacts to the repository as soon as they are produced or waiting for the last step of the pipeline.