You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-commits@maven.apache.org by sv...@apache.org on 2023/03/14 14:22:53 UTC
svn commit: r1908387 - in /maven/website/content: guides/mini/guide-http-settings.html guides/mini/guide-resolver-transport.html maven-site-1.0-site.jar
Author: svn-site-role
Date: Tue Mar 14 14:22:52 2023
New Revision: 1908387
Log:
Site checkin for project Apache Maven Site
Modified:
maven/website/content/guides/mini/guide-http-settings.html
maven/website/content/guides/mini/guide-resolver-transport.html
maven/website/content/maven-site-1.0-site.jar
Modified: maven/website/content/guides/mini/guide-http-settings.html
==============================================================================
--- maven/website/content/guides/mini/guide-http-settings.html (original)
+++ maven/website/content/guides/mini/guide-http-settings.html Tue Mar 14 14:22:52 2023
@@ -154,17 +154,11 @@
</header>
<main id="bodyColumn" class="span10" >
<section>
-<h1>Advanced Configuration of the Maven Wagon Transport</h1>
+<h1>Advanced configuration to HttpClient HTTP Wagon</h1>
<p><b>This page contains Wagon specific information, but the default transport in Maven 3.9.0+ is NOT Wagon anymore. Make sure to check <a href="./guide-resolver-transport.html">Resolver Transport guide</a> first, as things have changed.</b></p>
-<p>You can use the default transport for a given protocol, or you can select the transport you want by using the configuration. For more information about the existing Resolver transports see the <a class="externalLink" href="https://maven.apache.org/resolver/"> Resolver</a> site. The default transport in Maven 3.x is Transport-Wagon, the Wagon layer having been introduced in Maven 2.x. Since then, more modern transports were introduced as well, even supporting overlapping protocols. The default transport in Maven 3.9.x changed to the more modern <a class="externalLink" href="https://maven.apache.org/resolver/maven-resolver-transport-http/index.html">"native" HTTP</a> transport.</p>
-<p>Ultimate reference for resolver transport configuration can be found on <a class="externalLink" href="https://maven.apache.org/resolver/configuration.html"> configuration</a> page. While one can easily define simple typed values on command line using <code>-D...</code> switch, some more complex values, like HTTP headers, cannot.</p>
<ul>
-<li><a href="#Advanced_Configuration_of_the_Maven_Wagon_Transport">Advanced Configuration of the Maven Wagon Transport</a>
+<li><a href="#Advanced_configuration_to_HttpClient_HTTP_Wagon">Advanced configuration to HttpClient HTTP Wagon</a>
<ul>
-<li><a href="#Advanced_configuration_to_Wagon">Advanced configuration to Wagon</a>
-<ul>
-<li><a href="#HTTP_Headers">HTTP Headers</a></li>
-<li><a href="#Connection_Timeouts">Connection Timeouts</a></li></ul></li>
<li><a href="#Advanced_Configuration_of_the_HttpClient_HTTP_Wagon">Advanced Configuration of the HttpClient HTTP Wagon</a>
<ul>
<li><a href="#Introduction">Introduction</a></li>
@@ -179,45 +173,10 @@
<li><a href="#Ignoring_Cookies">Ignoring Cookies</a></li></ul></li>
<li><a href="#Support_for_General-Wagon_Configuration_Standards">Support for General-Wagon Configuration Standards</a>
<ul>
-<li><a href="#HTTP_Headers_1">HTTP Headers</a></li>
-<li><a href="#Connection_Timeouts_1">Connection Timeouts</a></li>
+<li><a href="#HTTP_Headers">HTTP Headers</a></li>
+<li><a href="#Connection_Timeouts">Connection Timeouts</a></li>
<li><a href="#Read_time_out">Read time out</a></li></ul></li>
<li><a href="#Resources">Resources</a></li></ul></li></ul></li></ul><section>
-<h2>Advanced configuration to Wagon</h2>
-<p>Using your <code>settings.xml</code> you can customize the transport configurations in several ways.</p><section>
-<h3>HTTP Headers</h3>
-<p>In all HTTP transports, you can add your custom HTTP headers like this:</p>
-<div class="source"><pre class="prettyprint linenums"><settings>
- <servers>
- <server>
- <id>my-server</id>
- <configuration>
- <httpHeaders>
- <property>
- <name>Foo</name>
- <value>Bar</value>
- </property>
- </httpHeaders>
- </configuration>
- </server>
- </servers>
-</settings></pre></div>
-<p>It is important to understand that the above approach does not allow you to turn off all of the default HTTP headers; nor does it allow you to specify headers on a per-method basis. However, this configuration remains available in all transports that support headers, like HTTP transports are.</p></section><section>
-<h3>Connection Timeouts</h3>
-<p>All transport implementations that perform some network access allow configuring several timeouts, for example to allow the user to tell Maven how long to wait before giving up on a connection that has not responded.</p>
-<div class="source"><pre class="prettyprint linenums"><settings>
- <servers>
- <server>
- <id>my-server</id>
- <configuration>
- <connectTimeout>10000</connectTimeout> <!-- milliseconds -->
- <requestTimeout>1800000</requestTimeout> <!-- milliseconds -->
- </configuration>
- </server>
- </servers>
-</settings></pre></div>
-<p>These above define per-server timeout configuration, and show default values.</p>
-<p>These are the standard ways to configure transport, regarding custom headers, and various timeouts. Each transport MAY introduce it's own specific configuration, like we can see below for Wagon.</p></section></section><section>
<h2>Advanced Configuration of the HttpClient HTTP Wagon</h2>
<p>You can use the default wagon implementation for a given protocol, or you can select an alternative wagon <code>provider</code> on a per-protocol basis. For more information, see the <a href="./guide-wagon-providers.html">Guide to Wagon Providers</a> [3]. The default wagon http(s) is the HttpClient based on <a class="externalLink" href="https://hc.apache.org/httpcomponents-client-4.5.x/">Apache Http Client 4.5</a>. HTTP connection pooling prevents reopening new connections to the same server for each request. This pool feature is configurable with some parameters [4]. The default wagon comes with some default configuration:</p>
<ul>
@@ -255,6 +214,7 @@ problems with HTTP servers and proxies t
<p>Another option to avoid this double transfer is what's known as preemptive authentication, which involves sending the authentication headers along with the original PUT request. However, there are a few potential issues with this approach. For one thing, in the event you have an unused <code><server></code> entry that specifies an invalid username/password combination, some servers may respond with a <code>401 Unauthorized</code> even if the server doesn't actually require any authentication for the request. In addition, blindly sending authentication credentials with every request regardless of whether the server has made a challenge can result in a security hole, since the server may not make provisions to secure credentials for paths that don't require authentication.</p>
<p>We'll discuss preemptive authentication in another example, below.</p></section><section>
<h3>Configuring GET, HEAD, PUT, or All of the Above</h3>
+<p><b>Starting with Maven 3.9.0 native HTTP transport will pick up the "all" settings only (get, head, put are neglected!)" but it will WARN about it's deprecation. For users sticking with Wagon nothing changes.</b></p>
<p>In all of the examples below, it's important to understand that you can configure the HTTP settings for all requests made to a given server, or for only one method. To configure all methods for a server, use the following section of the <code>settings.xml</code> file:</p>
<div class="source"><pre class="prettyprint linenums"><settings>
[...]
Modified: maven/website/content/guides/mini/guide-resolver-transport.html
==============================================================================
--- maven/website/content/guides/mini/guide-resolver-transport.html (original)
+++ maven/website/content/guides/mini/guide-resolver-transport.html Tue Mar 14 14:22:52 2023
@@ -181,7 +181,8 @@ changed from ancient Wagon to modern <co
contains several implementations, and this number will probably increase.</p>
<p>The Resolver contains configuration for many aspects, including transport (see the keys
prefixed with <code>aether.connector.</code>). They can be found on
-<a href="https://maven.apache.org/resolver/configuration.html" class="externalLink">resolver configuration page</a>.</p></section><section>
+<a href="https://maven.apache.org/resolver/configuration.html" class="externalLink">resolver configuration page</a>.</p>
+<p><strong>This page applies only to Maven 3.9.0 and newer.</strong></p></section><section>
<h2>Switching Between Transports</h2>
<p>The transport used by resolver can be controlled using the <code>-Dmaven.resolver.transport</code> user property, for which accepted
values are <code>native</code> (the default), <code>wagon</code> (uses legacy Wagon) and <code>auto</code> (delegates to resolver to sort
@@ -222,6 +223,22 @@ fallback is possible with explicit use o
<p>It is important to understand that the above approach does not allow you to turn off all the default HTTP headers;
nor does it allow you to specify headers on a per-method basis. However, this configuration remains available in all
transports that support headers, like HTTP transports are (and works for “native” but also Wagon transport).</p></section><section>
+<h2>Timeouts</h2>
+<p>All transport implementations that perform some network access allow configuring several timeouts,
+for example to allow the user to tell Maven how long to wait before giving up on a connection that has not responded.</p>
+
+<div class="source"><pre class="prettyprint linenums"><code class="language-xml"><settings>
+ <servers>
+ <server>
+ <id>my-server</id>
+ <configuration>
+ <connectTimeout>10000</connectTimeout> <!-- milliseconds -->
+ <requestTimeout>1800000</requestTimeout> <!-- milliseconds -->
+ </configuration>
+ </server>
+ </servers>
+</settings>
+</code></pre></div></section><section>
<h2>How To Upgrade from Wagon? (or “native transport does not work”)</h2>
<p>If your build environment uses Wagon specific configuration (in <code>settings.xml</code> or alike), you should migrate your
configuration first. You can still upgrade and use latest Maven, with use <code>-Dmaven.resolver.transport=wagon</code> user property
Modified: maven/website/content/maven-site-1.0-site.jar
==============================================================================
Binary files - no diff available.