The PublishToMavenLocal task uses the default CustomDeployTask created by AntTaskBackedMavenPublisher which sets uniqueVersion = true. This is incorrect for publishing to mavenLocal:
Non-unique Snapshot Deployments The setting false for a distribution repository has no effect in version 3.x, snapshot artifacts will always be deployed using a timestamped version.
The uniqueVersion settings only has no effect for a ‘distribution repository’ which I don’t believe applies to mavenLocal().
I updated the JIRA ticket with a maven project and the results I found. I’m not a maven expert but any means, but I used the Maven Shade Plugin project, updated the version to end in ‘-SNAPSHOT’ and ran ‘mvn install’ which installed the jar as non-unique.
Installing into the local Maven repository definitely needs to add a non-unique snapshot. (This allows tools such as IDEs to pick up new snapshots simply by refreshing the file.) Only question is if it should also add a unique snapshot. From what I remember, some Maven versions do. Not sure if they also prune old snapshots.
One workaround is to use the existing, non-incubating “maven” plugin. Another workaround is to write some code that renames the file after Gradle published it. I’m not aware of an easier solution.
1.7 is already in the RC phase, so a fix will have to wait for a later version. (We have a strict rule to only fix major regressions in RCs.)
(Off on a tanget: It is apparently just a direct match-on-end-of-string, if I use “1.0-XNAPSHOT”, it is not uniqueified).