[maven-release-plugin] copy for tag doxia-1.1.4
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia/tags/doxia-1.1.4@1035777 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
index 1ab472f..1c04265 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
@@ -724,14 +724,16 @@
{
// Doxia XSDs are included in the jars, so try to find the resource systemName from
// the classpath...
- URL url = getClass().getResource( "/" + systemName );
+ String resource = "/" + systemName;
+ URL url = getClass().getResource( resource );
if ( url != null )
{
res = toByteArray( url );
}
else
{
- throw new SAXException( "Could not find the SYSTEM entity: " + systemId );
+ throw new SAXException( "Could not find the SYSTEM entity: " + systemId
+ + " because '" + resource + "' is not available of the classpath." );
}
}
else
@@ -796,6 +798,9 @@
// it is an HTTP url, using HttpClient...
DefaultHttpClient client = new DefaultHttpClient();
HttpGet method = new HttpGet( url.toString() );
+ // Set a user-agent that doesn't contain the word "java", otherwise it will be blocked by the W3C
+ // The default user-agent is "Apache-HttpClient/4.0.2 (java 1.5)"
+ method.setHeader( "user-agent", "Apache-Doxia/1.1.4" );
HttpRequestRetryHandler retryHandler = new DefaultHttpRequestRetryHandler( 3, false );
client.setHttpRequestRetryHandler(retryHandler);
@@ -807,7 +812,9 @@
int statusCode = response.getStatusLine().getStatusCode();
if ( statusCode != HttpStatus.SC_OK )
{
- throw new IOException( "Method failed: " + response.getStatusLine().getReasonPhrase() );
+ throw new IOException( "The status code when accessing the URL '" + url.toString() + "' was "
+ + statusCode + ", which is not allowed. The server gave this reason for the failure '"
+ + response.getStatusLine().getReasonPhrase() + "'.");
}
entity = response.getEntity();