When I run ‘gradle uploadArchives’, the upload url used is the ‘public’ one NOT the ‘releases’ one specified in ‘mavenDeployer’. When I run this as a different user with no environment/cache/settings, it works as expected. I therefore surmise that there’s something in my specific environment that is causing gradle to not honor the setting (which I see as fundamentally flawed, but that’s just me). Is there a way to get gradle to tell me where it’s getting the incorrect repository reference? I’ve blown away my ~/.gradle and $project/.gradle directories, but to no avail; I’ve run gradle with the ‘-p’ and ‘-g’ options also to no avail. I actively use Ant, Maven and Eclipse on a Linux platform – could these be affecting things? Thanks for any input.
No really helpful messages like ‘using repository url from xyz as maven upload url’ but… after poring through the copious output I found a line stating that it was ‘Loading Maven settings file: …’ and that file had the ‘public’ url listed as a mirror (replaced angle brackets with square ones):
So I guessed that somehow this value was being used in place of my setting. The only reference to that directory was in my M2_HOME environment variable. I unset my M2_HOME environment variable and voila, it all worked.
I still don’t know WHY gradle ignored my stated repository, but, based on the amount of time spent on this issue, I humbly request that there be a mod added to gradle to let the user choose to have the explicit maven repository listed in the .gradle file override any environment settings.
I’ve made an unexpected observation. I had my settings.xml properly configured, but after disabeling entry by entry, gradle still used the public nexus repo for artifacts. So I doublechecked the logs and found out that I had an second settings.xml in my /conf of maven with some badly configured content. and gradle seems to be using it anyway.