Usage of .m2 local repository while artifact upload to remote repository

When uploading to a remote Maven repository I noticed (because disk was full) that Gradle uses the .m2 local repository in the user home dir to place a copy of the artifact to upload.

Is there a way to not have this copy? I upload also installation packages which are 250MB in size. So I get the disk quite quickly filled up.


Have a look at this thread:

There’s a workaround in the comments.

oh yes. I’ve tried the publish way and it work great, but than I have this nasty unique numbering. so I have to care about remote repo space now.