title: Gradle fails with not a valid response from a Gradle Plugin Resolution Service: content type is 'text/html', expected 'application/json'
body: <p>I am using IntelliJ and am behind a firewall when at the work office.  I have configured IntelliJ to use the automatic URL config for the proxy and this seems to be working but I get this error when behind the proxy, but when not using the proxy it works as expected.</p>
  
  <pre><code>Error:(20, 0) The response from https://plugins.gradle.org/api/gradle/2.10/plugin/use/org.flywaydb.flyway/4.0.3 was not a valid response from a Gradle Plugin Resolution Service: content type is 'text/html', expected 'application/json'
  </code></pre>
  
  <p>How can I fix this?</p>
  
  <p>EDIT:  I forgot to mention I have the following setup in my gradle.properties, obviously with real info and not *****</p>
  
  <pre><code>systemProp.http.auth.ntlm.domain=******
  systemProp.https.proxyHost=http://*****/
  systemProp.https.proxyPort=80
  systemProp.http.proxyUser=******
  systemProp.http.proxyPassword=****
  </code></pre>
  
  <p>After changing that to be </p>
  
  <pre><code>systemProp.http.proxyHost=***
  systemProp.http.proxyPort=80
  systemProp.http.proxyUser=***
  systemProp.http.proxyPassword=**
  systemProp.https.proxyHost=**
  systemProp.https.proxyPort=80
  systemProp.https.proxyUser=**
  systemProp.https.proxyPassword=**
  </code></pre>
  
  <p>I now get this erro:</p>
  
  <pre><code>Error:(20, 0) The response from https://plugins.gradle.org/api/gradle/3.0/plugin/use/org.flywaydb.flyway/4.0.3 was not a valid response from a Gradle Plugin Resolution Service: content type is 'text/html', expected 'application/json' (status code: 407)
  </code></pre>
  
  <p>But using the same setting in IntelliJ and setting the proxy manually it passes its test (click the config test button in settings)</p>