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

**URL:** <https://discuss.gradle.org/t/error-code-301-when-publishing-with-maven-publish-and-gradle-2-4/10291>\
**Category:** Bugs\
**Tags:** gradle-3312, issue-acknowledged\
**Created:** [June 25, 2015, 3:39pm UTC](https://discuss.gradle.org/t/error-code-301-when-publishing-with-maven-publish-and-gradle-2-4/10291 "2015-06-25T15:39:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vfoixcable](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@vfoixcable](https://discuss.gradle.org/u/vfoixcable)\
**Post date:** [June 25, 2015, 3:39pm UTC](https://discuss.gradle.org/t/error-code-301-when-publishing-with-maven-publish-and-gradle-2-4/10291/1 "2015-06-25T15:39:00Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![sterling](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/sterling/32/5395_2.png) [@sterling](https://discuss.gradle.org/u/sterling)\
**Post date:** [June 25, 2015, 5:49pm UTC](https://discuss.gradle.org/t/error-code-301-when-publishing-with-maven-publish-and-gradle-2-4/10291/2 "2015-06-25T17:49:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [June 26, 2015, 12:03am UTC](https://discuss.gradle.org/t/error-code-301-when-publishing-with-maven-publish-and-gradle-2-4/10291/3 "2015-06-26T00:03:15Z")

</div>

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