Error Code 301 when publishing with maven-publish and Gradle 2.4

Hi,

After upgrading from Gradle 2.3 to Gradle 2.4, it seems that something is broken with the “maven-publish” plugin.
We have a redirect in our url (i.e. https://my.company.com/snapshots should be redirect to the real url) that defines the path to our nexus. This redirect is properly and successfully handled with Gradle 2.3 (handled by sun.net.www.protocol.http.HttpURLConnection). However, the redirect fails with Gradle 2.4 (handled by org.apache.http.impl.conn.DefaultClientConnection). (error code 301 : Moved Permanently)
As a first fix, we provide now the real url but you may be interested in the issue.
Please also note that the issue is still the same with Gradle 2.5-RC1

Thanks @vfoixcable! I created GRADLE-3312

@Adrian_Kelly: do you think this is related to the S3/SFTP changes made in 2.4?

@luke_daley: do we want to fix this for 2.5-rc-2?

@sterling yes, this is a regression and blocker for 2.5 final.