mirror of https://github.com/apache/maven.git
be more forceful on the no-cache
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d3c5de773f
commit
e2c9a495e7
|
@ -67,9 +67,8 @@ public class HttpUtils
|
||||||
{
|
{
|
||||||
protected PasswordAuthentication getPasswordAuthentication()
|
protected PasswordAuthentication getPasswordAuthentication()
|
||||||
{
|
{
|
||||||
return new PasswordAuthentication( proxyUserName,
|
return new PasswordAuthentication( proxyUserName, proxyPassword == null
|
||||||
proxyPassword == null
|
? new char[0] : proxyPassword.toCharArray() );
|
||||||
? new char[0] : proxyPassword.toCharArray() );
|
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
@ -210,7 +209,7 @@ public class HttpUtils
|
||||||
connection.setRequestProperty( "Authorization", "Basic " + encoding );
|
connection.setRequestProperty( "Authorization", "Basic " + encoding );
|
||||||
}
|
}
|
||||||
|
|
||||||
connection.setUseCaches( false );
|
connection.setRequestProperty( "Pragma", "no-cache" );
|
||||||
|
|
||||||
//connect to the remote site (may take some time)
|
//connect to the remote site (may take some time)
|
||||||
connection.connect();
|
connection.connect();
|
||||||
|
@ -223,10 +222,9 @@ public class HttpUtils
|
||||||
// test for 404 ourselves, and throw FileNotFoundException as needed
|
// test for 404 ourselves, and throw FileNotFoundException as needed
|
||||||
if ( httpConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND )
|
if ( httpConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND )
|
||||||
{
|
{
|
||||||
throw new FileNotFoundException(
|
throw new FileNotFoundException( url.toString() + " (HTTP Error: " + httpConnection.getResponseCode() +
|
||||||
url.toString() + " (HTTP Error: " + httpConnection.getResponseCode() + " " +
|
" " +
|
||||||
httpConnection.getResponseMessage() +
|
httpConnection.getResponseMessage() + ")" );
|
||||||
")" );
|
|
||||||
}
|
}
|
||||||
if ( httpConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED )
|
if ( httpConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue