When executing an Upload task, the generated artifacts are always also deployed to the local repository (whatever the actual target repo is), which by default is ~/.m2/repository.
I’d like to be override the location of this local repository through an env var or something. Is that possible?
This functionality is buried deep in the Maven libs we use for this so we can’t easily turn it off unfortunately. Our new publishing stuff doesn’t have this problem though. If you set M2_HOME to a junk space for the Gradle process it will write there. I’m less sure about changing the env var in flight. I’ll investigate and post back.
I’m still using the old publishing stuff with the M2_HOME overriden and it still puts still in ~/.m2/repository instead of the path pointed to by M2_HOME.
We don’t have a good solution for dealing with signing with the new stuff yet unfortunately. I think I have a workaround for you for the old stuff though.
This works for me to though I’m confused. my ~/.m2 folder stayed empty for the fakem2home folder in each sub project’s buildDir is empty too, which seems strange to me…