View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.eclipse.aether;
20  
21  /**
22   * The keys and defaults for common configuration properties.
23   *
24   * @see RepositorySystemSession#getConfigProperties()
25   */
26  public final class ConfigurationProperties {
27  
28      /**
29       * Prefix for all configurations. <em>For internal use only.</em>
30       *
31       * @since 2.0.0
32       */
33      public static final String PREFIX_AETHER = "aether.";
34  
35      /**
36       * Prefix for repository system related configurations. <em>For internal use only.</em>
37       *
38       * @since 2.0.0
39       */
40      public static final String PREFIX_SYSTEM = PREFIX_AETHER + "system.";
41  
42      /**
43       * Prefix for sync context related configurations. <em>For internal use only.</em>
44       *
45       * @since 2.0.0
46       */
47      public static final String PREFIX_SYNC_CONTEXT = PREFIX_AETHER + "syncContext.";
48  
49      /**
50       * Prefix for connector related configurations. <em>For internal use only.</em>
51       *
52       * @since 2.0.0
53       */
54      public static final String PREFIX_CONNECTOR = PREFIX_AETHER + "connector.";
55  
56      /**
57       * Prefix for layout related configurations. <em>For internal use only.</em>
58       *
59       * @since 2.0.0
60       */
61      public static final String PREFIX_LAYOUT = PREFIX_AETHER + "layout.";
62  
63      /**
64       * Prefix for checksum related configurations. <em>For internal use only.</em>
65       *
66       * @since 2.0.0
67       */
68      public static final String PREFIX_CHECKSUMS = PREFIX_AETHER + "checksums.";
69  
70      /**
71       * Prefix for local repository manager related configurations. <em>For internal use only.</em>
72       *
73       * @since 2.0.0
74       */
75      public static final String PREFIX_LRM = PREFIX_AETHER + "lrm.";
76  
77      /**
78       * Prefix for generator related configurations. <em>For internal use only.</em>
79       *
80       * @since 2.0.0
81       */
82      public static final String PREFIX_GENERATOR = PREFIX_AETHER + "generator.";
83  
84      /**
85       * Prefix for util related configurations. <em>For internal use only.</em>
86       *
87       * @since 2.0.10
88       */
89      public static final String PREFIX_UTIL = PREFIX_AETHER + "util.";
90  
91      /**
92       * Prefix for transport related configurations. <em>For internal use only.</em>
93       *
94       * @since 2.0.0
95       */
96      public static final String PREFIX_TRANSPORT = PREFIX_AETHER + "transport.";
97  
98      /**
99       * Prefix for HTTP protocol related configurations. <em>For internal use only.</em>
100      *
101      * @since 2.0.0
102      */
103     public static final String PREFIX_TRANSPORT_HTTP = PREFIX_TRANSPORT + "http.";
104 
105     /**
106      * Prefix for HTTPS protocol related configurations. <em>For internal use only.</em>
107      *
108      * @since 2.0.0
109      */
110     public static final String PREFIX_TRANSPORT_HTTPS = PREFIX_TRANSPORT + "https.";
111 
112     /**
113      * The prefix for properties that control the priority of pluggable extensions like transporters. For example, for
114      * an extension with the fully qualified class name "org.eclipse.MyExtensionFactory", the configuration properties
115      * "aether.priority.org.eclipse.MyExtensionFactory", "aether.priority.MyExtensionFactory" and
116      * "aether.priority.MyExtension" will be consulted for the priority, in that order (obviously, the last key is only
117      * tried if the class name ends with "Factory"). The corresponding value is a float and the special value
118      * {@link Float#NaN} or "NaN" (case-sensitive) can be used to disable the extension.
119      */
120     public static final String PREFIX_PRIORITY = PREFIX_AETHER + "priority.";
121 
122     /**
123      * A flag indicating whether the priorities of pluggable extensions are implicitly given by their iteration order
124      * such that the first extension has the highest priority. If set, an extension's built-in priority as well as any
125      * corresponding {@code aether.priority.*} configuration properties are ignored when searching for a suitable
126      * implementation among the available extensions. This priority mode is meant for cases where the application will
127      * present/inject extensions in the desired search order.
128      *
129      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
130      * @configurationType {@link java.lang.Boolean}
131      * @configurationDefaultValue {@link #DEFAULT_IMPLICIT_PRIORITIES}
132      * @configurationRepoIdSuffix No
133      */
134     public static final String IMPLICIT_PRIORITIES = PREFIX_PRIORITY + "implicit";
135 
136     /**
137      * The default extension priority mode if {@link #IMPLICIT_PRIORITIES} isn't set.
138      */
139     public static final boolean DEFAULT_IMPLICIT_PRIORITIES = false;
140 
141     /**
142      * A flag indicating whether the created ordered components should be cached in session.
143      *
144      * @since 2.0.0
145      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
146      * @configurationType {@link java.lang.Boolean}
147      * @configurationDefaultValue {@link #DEFAULT_CACHED_PRIORITIES}
148      * @configurationRepoIdSuffix No
149      */
150     public static final String CACHED_PRIORITIES = PREFIX_PRIORITY + "cached";
151 
152     /**
153      * The default caching of priority components if {@link #CACHED_PRIORITIES} isn't set. Default value is {@code true}.
154      *
155      * @since 2.0.0
156      */
157     public static final boolean DEFAULT_CACHED_PRIORITIES = true;
158 
159     /**
160      * The priority to use for a certain extension class. {@code &lt;class&gt;} can either be the fully qualified
161      * name or the simple name of a class. If the class name ends with Factory that suffix could optionally be left out.
162      * This configuration is used by {@code org.eclipse.aether.internal.impl.PrioritizedComponents} internal utility
163      * to sort classes by priority. This is reusable utility (so an extension can make use of it), but by default
164      * in "vanilla" Resolver following classes are sorted:
165      * <ul>
166      *     <li>{@code org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory}</li>
167      *     <li>{@code org.eclipse.aether.spi.connector.RepositoryConnectorFactory}</li>
168      *     <li>{@code org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory}</li>
169      *     <li>{@code org.eclipse.aether.spi.connector.transport.TransporterFactory}</li>
170      *     <li>{@code org.eclipse.aether.spi.artifact.decorator.ArtifactDecoratorFactory}</li>
171      *     <li>{@code org.eclipse.aether.spi.artifact.generator.ArtifactGeneratorFactory}</li>
172      *     <li>{@code org.eclipse.aether.impl.MetadataGeneratorFactory}</li>
173      * </ul>
174      *
175      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
176      * @configurationType {@link java.lang.Float}
177      * @configurationRepoIdSuffix No
178      */
179     public static final String CLASS_PRIORITIES = PREFIX_PRIORITY + "<class>";
180 
181     /**
182      * A flag indicating whether interaction with the user is allowed.
183      *
184      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
185      * @configurationType {@link java.lang.Boolean}
186      * @configurationDefaultValue {@link #DEFAULT_INTERACTIVE}
187      * @configurationRepoIdSuffix No
188      */
189     public static final String INTERACTIVE = PREFIX_AETHER + "interactive";
190 
191     /**
192      * The default interactive mode if {@link #INTERACTIVE} isn't set.
193      */
194     public static final boolean DEFAULT_INTERACTIVE = false;
195 
196     /**
197      * The user agent that repository connectors should report to servers.
198      *
199      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
200      * @configurationType {@link java.lang.String}
201      * @configurationDefaultValue {@link #DEFAULT_USER_AGENT}
202      * @configurationRepoIdSuffix No
203      */
204     public static final String USER_AGENT = PREFIX_TRANSPORT_HTTP + "userAgent";
205 
206     /**
207      * The default user agent to use if {@link #USER_AGENT} isn't set.
208      */
209     public static final String DEFAULT_USER_AGENT = "Aether";
210 
211     /**
212      * The maximum amount of time (in milliseconds) to wait for a successful connection to a remote server. Non-positive
213      * values indicate no timeout.
214      *
215      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
216      * @configurationType {@link java.lang.Integer}
217      * @configurationDefaultValue {@link #DEFAULT_CONNECT_TIMEOUT}
218      * @configurationRepoIdSuffix Yes
219      */
220     public static final String CONNECT_TIMEOUT = PREFIX_TRANSPORT_HTTP + "connectTimeout";
221 
222     /**
223      * The default connect timeout to use if {@link #CONNECT_TIMEOUT} isn't set.
224      */
225     public static final int DEFAULT_CONNECT_TIMEOUT = 30 * 1000;
226 
227     /**
228      * The maximum amount of time (in milliseconds) to wait for remaining data to arrive from a remote server. Note that
229      * this timeout does not restrict the overall duration of a request, it only restricts the duration of inactivity
230      * between consecutive data packets. Non-positive values indicate no timeout.
231      *
232      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
233      * @configurationType {@link java.lang.Integer}
234      * @configurationDefaultValue {@link #DEFAULT_REQUEST_TIMEOUT}
235      * @configurationRepoIdSuffix Yes
236      */
237     public static final String REQUEST_TIMEOUT = PREFIX_TRANSPORT_HTTP + "requestTimeout";
238 
239     /**
240      * The default request timeout to use if {@link #REQUEST_TIMEOUT} isn't set.
241      */
242     public static final int DEFAULT_REQUEST_TIMEOUT = 1800 * 1000;
243 
244     /**
245      * The request headers to use for HTTP-based repository connectors. The headers are specified using a
246      * {@code Map<String, String>}, mapping a header name to its value. Besides this general key, clients may also
247      * specify headers for a specific remote repository by appending the suffix {@code .&lt;repoId&gt;} to this key when
248      * storing the headers map. The repository-specific headers map is supposed to be complete, i.e. is not merged with
249      * the general headers map.
250      * <p>
251      * <strong>Security note:</strong> configured headers are attached to every request the transport sends for the
252      * repository and, depending on the transport implementation, may be re-sent when the repository responds with
253      * a redirect - including redirects that leave the repository origin. Avoid placing credentials (for example
254      * {@code Authorization}, cookies or private token headers) in this map where repository authentication can be
255      * used instead: repository authentication is negotiated per host. All shipped HTTP transports scope configured
256      * headers to the repository origin by default, see the per-transport {@code originScopedHeaders} configuration
257      * keys ({@code aether.transport.apache.originScopedHeaders}, {@code aether.transport.jdk.originScopedHeaders},
258      * {@code aether.transport.jetty.originScopedHeaders}).
259      *
260      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
261      * @configurationType {@link java.util.Map}
262      * @configurationRepoIdSuffix Yes
263      */
264     public static final String HTTP_HEADERS = PREFIX_TRANSPORT_HTTP + "headers";
265 
266     /**
267      * The encoding/charset to use when exchanging credentials with HTTP servers. Besides this general key, clients may
268      * also specify the encoding for a specific remote repository by appending the suffix {@code .&lt;repoId&gt;} to this key
269      * when storing the charset name.
270      *
271      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
272      * @configurationType {@link java.lang.String}
273      * @configurationDefaultValue {@link #DEFAULT_HTTP_CREDENTIAL_ENCODING}
274      * @configurationRepoIdSuffix Yes
275      */
276     public static final String HTTP_CREDENTIAL_ENCODING = PREFIX_TRANSPORT_HTTP + "credentialEncoding";
277 
278     /**
279      * The default encoding/charset to use if {@link #HTTP_CREDENTIAL_ENCODING} isn't set.
280      */
281     public static final String DEFAULT_HTTP_CREDENTIAL_ENCODING = "ISO-8859-1";
282 
283     /**
284      * The maximum number of times a request to a remote server should be retried in case of an error.
285      *
286      * @since 1.9.6
287      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
288      * @configurationType {@link java.lang.Integer}
289      * @configurationDefaultValue {@link #DEFAULT_HTTP_RETRY_HANDLER_COUNT}
290      * @configurationRepoIdSuffix Yes
291      */
292     public static final String HTTP_RETRY_HANDLER_COUNT = PREFIX_TRANSPORT_HTTP + "retryHandler.count";
293 
294     /**
295      * The default number of retries to use if {@link #HTTP_RETRY_HANDLER_COUNT} isn't set.
296      *
297      * @since 1.9.6
298      */
299     public static final int DEFAULT_HTTP_RETRY_HANDLER_COUNT = 3;
300 
301     /**
302      * The initial retry interval in millis of request to a remote server should be waited in case of
303      * "too many requests" (HTTP codes 429 and 503). Accepts long as milliseconds. This value is used if remote server
304      * does not use {@code Retry-After} header, in which case Server value is obeyed.
305      *
306      * @since 1.9.16
307      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
308      * @configurationType {@link java.lang.Long}
309      * @configurationDefaultValue {@link #DEFAULT_HTTP_RETRY_HANDLER_INTERVAL}
310      * @configurationRepoIdSuffix Yes
311      */
312     public static final String HTTP_RETRY_HANDLER_INTERVAL = PREFIX_TRANSPORT_HTTP + "retryHandler.interval";
313 
314     /**
315      * The default initial retry interval to use if {@link #HTTP_RETRY_HANDLER_INTERVAL} isn't set.
316      * Default value 5000ms.
317      *
318      * @since 1.9.16
319      */
320     public static final long DEFAULT_HTTP_RETRY_HANDLER_INTERVAL = 5000L;
321 
322     /**
323      * The maximum retry interval in millis of request to a remote server above which the request should be aborted
324      * instead. In theory, a malicious server could tell Maven "come back after 100 years" that would stall the build
325      * for some. Using this parameter Maven will fail the request instead, if interval is above this value.
326      *
327      * @since 1.9.16
328      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
329      * @configurationType {@link java.lang.Long}
330      * @configurationDefaultValue {@link #DEFAULT_HTTP_RETRY_HANDLER_INTERVAL_MAX}
331      * @configurationRepoIdSuffix Yes
332      */
333     public static final String HTTP_RETRY_HANDLER_INTERVAL_MAX = PREFIX_TRANSPORT_HTTP + "retryHandler.intervalMax";
334 
335     /**
336      * The default retry interval maximum to use if {@link #HTTP_RETRY_HANDLER_INTERVAL_MAX} isn't set.
337      * Default value 5 minutes.
338      *
339      * @since 1.9.16
340      */
341     public static final long DEFAULT_HTTP_RETRY_HANDLER_INTERVAL_MAX = 300_000L;
342 
343     /**
344      * The HTTP codes of remote server responses that should be handled as "too many requests"
345      * (examples: HTTP codes 429 and 503). Accepts comma separated list of HTTP response codes.
346      *
347      * @since 1.9.16
348      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
349      * @configurationType {@link java.lang.String}
350      * @configurationDefaultValue {@link #DEFAULT_HTTP_RETRY_HANDLER_SERVICE_UNAVAILABLE}
351      * @configurationRepoIdSuffix Yes
352      */
353     public static final String HTTP_RETRY_HANDLER_SERVICE_UNAVAILABLE =
354             PREFIX_TRANSPORT_HTTP + "retryHandler.serviceUnavailable";
355 
356     /**
357      * The default HTTP codes of remote server responses that should be handled as "too many requests".
358      * Default value: "429,503".
359      *
360      * @since 1.9.16
361      */
362     public static final String DEFAULT_HTTP_RETRY_HANDLER_SERVICE_UNAVAILABLE = "429,503";
363 
364     /**
365      * Should HTTP client use preemptive-authentication for all HTTP verbs (works only w/ BASIC). By default, is
366      * disabled, as it is considered less secure.
367      *
368      * @since 1.9.6
369      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
370      * @configurationType {@link java.lang.Boolean}
371      * @configurationDefaultValue {@link #DEFAULT_HTTP_PREEMPTIVE_AUTH}
372      * @configurationRepoIdSuffix Yes
373      */
374     public static final String HTTP_PREEMPTIVE_AUTH = PREFIX_TRANSPORT_HTTP + "preemptiveAuth";
375 
376     /**
377      * The default value to use if {@link #HTTP_PREEMPTIVE_AUTH} isn't set (false).
378      *
379      * @since 1.9.6
380      */
381     public static final boolean DEFAULT_HTTP_PREEMPTIVE_AUTH = false;
382 
383     /**
384      * Should HTTP client reuse connections (in other words, pool connections) or not?
385      *
386      * @since 1.9.8
387      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
388      * @configurationType {@link java.lang.Boolean}
389      * @configurationDefaultValue {@link #DEFAULT_HTTP_REUSE_CONNECTIONS}
390      * @configurationRepoIdSuffix Yes
391      */
392     public static final String HTTP_REUSE_CONNECTIONS = PREFIX_TRANSPORT_HTTP + "reuseConnections";
393 
394     /**
395      * The default value to use if {@link #HTTP_REUSE_CONNECTIONS} isn't set (true).
396      *
397      * @since 1.9.8
398      */
399     public static final boolean DEFAULT_HTTP_REUSE_CONNECTIONS = true;
400 
401     /**
402      * Total time to live in seconds for an HTTP connection, after that time, the connection will be dropped
403      * (no matter for how long it was idle).
404      *
405      * @since 1.9.8
406      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
407      * @configurationType {@link java.lang.Integer}
408      * @configurationDefaultValue {@link #DEFAULT_HTTP_CONNECTION_MAX_TTL}
409      * @configurationRepoIdSuffix Yes
410      */
411     public static final String HTTP_CONNECTION_MAX_TTL = PREFIX_TRANSPORT_HTTP + "connectionMaxTtl";
412 
413     /**
414      * The default value to use if {@link #HTTP_CONNECTION_MAX_TTL} isn't set (300 seconds).
415      *
416      * @since 1.9.8
417      */
418     public static final int DEFAULT_HTTP_CONNECTION_MAX_TTL = 300;
419 
420     /**
421      * The maximum concurrent connections per route HTTP client is allowed to use.
422      *
423      * @since 1.9.8
424      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
425      * @configurationType {@link java.lang.Integer}
426      * @configurationDefaultValue {@link #DEFAULT_HTTP_MAX_CONNECTIONS_PER_ROUTE}
427      * @configurationRepoIdSuffix Yes
428      */
429     public static final String HTTP_MAX_CONNECTIONS_PER_ROUTE = PREFIX_TRANSPORT_HTTP + "maxConnectionsPerRoute";
430 
431     /**
432      * The default value to use if {@link #HTTP_MAX_CONNECTIONS_PER_ROUTE} isn't set (50 connections).
433      *
434      * @since 1.9.8
435      */
436     public static final int DEFAULT_HTTP_MAX_CONNECTIONS_PER_ROUTE = 50;
437 
438     /**
439      * The local address (interface) to use with HTTP transport. Not all transport supports this option.
440      *
441      * @since 2.0.0
442      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
443      * @configurationType {@link java.lang.String}
444      * @configurationRepoIdSuffix Yes
445      */
446     public static final String HTTP_LOCAL_ADDRESS = PREFIX_TRANSPORT_HTTP + "localAddress";
447 
448     /**
449      * Boolean flag should the HTTP transport support WebDAV remote. Not all transport support this option.
450      *
451      * @since 2.0.0 (moved out from maven-resolver-transport-http).
452      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
453      * @configurationType {@link java.lang.Boolean}
454      * @configurationDefaultValue {@link #DEFAULT_HTTP_SUPPORT_WEBDAV}
455      * @configurationRepoIdSuffix Yes
456      */
457     public static final String HTTP_SUPPORT_WEBDAV = PREFIX_TRANSPORT_HTTP + "supportWebDav";
458 
459     /**
460      * Default value to use if {@link #HTTP_SUPPORT_WEBDAV} is not set: {@code false}.
461      *
462      * @since 2.0.0
463      */
464     public static final boolean DEFAULT_HTTP_SUPPORT_WEBDAV = false;
465 
466     /**
467      * Boolean flag should the HTTP transport use preemptive-auth for PUT requests. Not all transport support this
468      * option.
469      *
470      * @since 2.0.0 (moved out from maven-resolver-transport-http).
471      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
472      * @configurationType {@link java.lang.Boolean}
473      * @configurationDefaultValue {@link #DEFAULT_HTTP_PREEMPTIVE_PUT_AUTH}
474      * @configurationRepoIdSuffix Yes
475      */
476     public static final String HTTP_PREEMPTIVE_PUT_AUTH = PREFIX_TRANSPORT_HTTP + "preemptivePutAuth";
477 
478     /**
479      * Default value if {@link #HTTP_PREEMPTIVE_PUT_AUTH} is not set: {@code true}.
480      *
481      * @since 2.0.0
482      */
483     public static final boolean DEFAULT_HTTP_PREEMPTIVE_PUT_AUTH = true;
484 
485     /**
486      * Boolean flag should the HTTP transport use expect-continue handshake for PUT requests. Not all transport support
487      * this option. This option may be needed for some broken HTTP servers. Default value corresponds to given
488      * transport default one (resolver does not override those), but if configuration IS given, it will replace
489      * given transport own default value.
490      *
491      * @since 1.9.17
492      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
493      * @configurationType {@link java.lang.Boolean}
494      * @configurationRepoIdSuffix Yes
495      */
496     public static final String HTTP_EXPECT_CONTINUE = PREFIX_TRANSPORT_HTTP + "expectContinue";
497 
498     /**
499      * The mode that sets HTTPS transport "security mode": to ignore any SSL errors (certificate validity checks,
500      * hostname verification). The default value is {@link #HTTPS_SECURITY_MODE_DEFAULT}.
501      *
502      * @see #HTTPS_SECURITY_MODE_DEFAULT
503      * @see #HTTPS_SECURITY_MODE_INSECURE
504      * @since 1.9.6
505      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
506      * @configurationType {@link java.lang.String}
507      * @configurationDefaultValue {@link #HTTPS_SECURITY_MODE_DEFAULT}
508      * @configurationRepoIdSuffix Yes
509      */
510     public static final String HTTPS_SECURITY_MODE = PREFIX_TRANSPORT_HTTPS + "securityMode";
511 
512     /**
513      * The default HTTPS security mode.
514      *
515      * @since 1.9.6
516      */
517     public static final String HTTPS_SECURITY_MODE_DEFAULT = "default";
518 
519     /**
520      * The insecure HTTPS security mode (certificate validation, hostname verification are all ignored).
521      *
522      * @since 1.9.6
523      */
524     public static final String HTTPS_SECURITY_MODE_INSECURE = "insecure";
525 
526     public enum HttpVersion {
527         /**
528          * The default HTTP version supported by the respective transporter (the most recent stable one, usually HTTP/2)
529          */
530         DEFAULT,
531         HTTP_1_1,
532         HTTP_2,
533         HTTP_3,
534         /**
535          * The maximum HTTP version supported by the respective transporter (may be unstable).
536          */
537         MAXIMUM;
538     }
539 
540     /**
541      * The maximum and preferred HTTP version. Some transporters transparently fall back to lower versions if remote server does not
542      * support the requested version, while other may just simply fail the request.
543      * Value must be a {@link HttpVersion} enum value or its String representation.
544      *
545      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
546      * @configurationType {@link ConfigurationProperties.HttpVersion}
547      * @configurationDefaultValue {@link #DEFAULT_HTTP_VERSION}
548      * @configurationRepoIdSuffix Yes
549      * @since 2.0.21
550      */
551     public static final String HTTP_VERSION = PREFIX_TRANSPORT_HTTP + "version";
552 
553     /**
554      * Default value if {@link #HTTP_VERSION} is not set.
555      *
556      * @since 2.0.21
557      */
558     public static final HttpVersion DEFAULT_HTTP_VERSION = HttpVersion.DEFAULT;
559 
560     /**
561      * A flag indicating which visitor should be used to "flatten" the dependency graph into list. In Maven 4
562      * the default is new "levelOrder", while Maven 3 used "preOrder". This property accepts values
563      * "preOrder", "postOrder" and "levelOrder".
564      *
565      * @see #REPOSITORY_SYSTEM_DEPENDENCY_VISITOR_PREORDER
566      * @see #REPOSITORY_SYSTEM_DEPENDENCY_VISITOR_POSTORDER
567      * @see #REPOSITORY_SYSTEM_DEPENDENCY_VISITOR_LEVELORDER
568      * @since 2.0.0
569      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
570      * @configurationType {@link java.lang.String}
571      * @configurationDefaultValue {@link #DEFAULT_REPOSITORY_SYSTEM_DEPENDENCY_VISITOR}
572      * @configurationRepoIdSuffix No
573      */
574     public static final String REPOSITORY_SYSTEM_DEPENDENCY_VISITOR = PREFIX_SYSTEM + "dependencyVisitor";
575 
576     /**
577      * The visitor strategy "preOrder".
578      *
579      * @since 2.0.0
580      */
581     public static final String REPOSITORY_SYSTEM_DEPENDENCY_VISITOR_PREORDER = "preOrder";
582 
583     /**
584      * The visitor strategy "postOrder". This was the only one supported in Resolver 1.x and is hence the
585      * default as well.
586      *
587      * @since 2.0.0
588      */
589     public static final String REPOSITORY_SYSTEM_DEPENDENCY_VISITOR_POSTORDER = "postOrder";
590 
591     /**
592      * The visitor strategy "levelOrder".
593      *
594      * @since 2.0.0
595      */
596     public static final String REPOSITORY_SYSTEM_DEPENDENCY_VISITOR_LEVELORDER = "levelOrder";
597 
598     /**
599      * The default visitor strategy.
600      *
601      * @since 2.0.12
602      */
603     public static final String DEFAULT_REPOSITORY_SYSTEM_DEPENDENCY_VISITOR =
604             REPOSITORY_SYSTEM_DEPENDENCY_VISITOR_LEVELORDER;
605 
606     /**
607      * <b>Experimental:</b> Configuration for system-wide "repository key" function.
608      * Accepted and recommended values: "nid" (default), "nid_hurl" and "ngurk", while "simple" is Maven 3 legacy,
609      * technically equivalent to "nid". For complete description see enum
610      * {@code org.eclipse.aether.util.repository.RepositoryIdHelper.RepositoryKeyType} in utils. <em>Warning:</em>
611      * repository key function affects Resolver fundamentally and may have unexpected results! Only change this
612      * if you know what you are doing!
613      *
614      * @since 2.0.14
615      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
616      * @configurationType {@link java.lang.String}
617      * @configurationDefaultValue {@link #DEFAULT_REPOSITORY_SYSTEM_REPOSITORY_KEY_FUNCTION}
618      */
619     public static final String REPOSITORY_SYSTEM_REPOSITORY_KEY_FUNCTION = PREFIX_SYSTEM + "repositoryKeyFunction";
620 
621     public static final String DEFAULT_REPOSITORY_SYSTEM_REPOSITORY_KEY_FUNCTION = "nid";
622 
623     /**
624      * Repository key function used for the provenance tracking entries that this local repository manager
625      * writes and reads. With an ID-only key, a repository declared in an untrusted (for example, transitively
626      * resolved) POM under the same ID as a trusted repository would be tracked as the same origin, potentially
627      * poisoning a shared local repository. The default is therefore the URL-qualified {@code "nid_hurl"}
628      * function.
629      * <p>
630      * This function is scoped to tracking entries, path composition, and split local repository prefixes.
631      * Repository identity used for aggregation and mirror merging continues to follow the system-wide key
632      * function ({@link #REPOSITORY_SYSTEM_REPOSITORY_KEY_FUNCTION}), whose default is unchanged.
633      * If the system-wide function is explicitly configured, tracking follows it (setting it to {@code "nid"}
634      * restores the legacy ID-only behaviour); this property, when set, overrides both.
635      * <p>
636      * Tracking entries written under a different function than the active one never match a lookup and never
637      * enable the untracked-file fallback: affected artifacts are treated as locally unavailable and
638      * re-fetched (with checksum validation) once.
639      *
640      * @since 2.0.23
641      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
642      * @configurationType {@link java.lang.String}
643      * @configurationDefaultValue {@link #DEFAULT_REPOSITORY_TRACKING_REPOSITORY_KEY_FUNCTION}
644      */
645     public static final String REPOSITORY_TRACKING_REPOSITORY_KEY_FUNCTION =
646             PREFIX_SYSTEM + "trackingRepositoryKeyFunction";
647 
648     public static final String DEFAULT_REPOSITORY_TRACKING_REPOSITORY_KEY_FUNCTION = "nid_hurl";
649 
650     /**
651      * A flag indicating whether version scheme cache statistics should be printed on JVM shutdown.
652      * This is useful for analyzing cache performance and effectiveness in development and testing scenarios.
653      *
654      * @since 2.0.10
655      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
656      * @configurationType {@link java.lang.Boolean}
657      * @configurationDefaultValue {@link #DEFAULT_VERSION_SCHEME_CACHE_DEBUG}
658      * @configurationRepoIdSuffix No
659      */
660     public static final String VERSION_SCHEME_CACHE_DEBUG = PREFIX_UTIL + "versionScheme.cacheDebug";
661 
662     /**
663      * The default value for version scheme cache debug if {@link #VERSION_SCHEME_CACHE_DEBUG} isn't set.
664      *
665      * @since 2.0.10
666      */
667     public static final boolean DEFAULT_VERSION_SCHEME_CACHE_DEBUG = false;
668 
669     /**
670      * Boolean flag should the HTTP transport send HTTP <pre>Accept</pre> header to signal that it supports RFC 9457
671      * error messages. Some servers have issues with handling the HTTP Accept headers. Known servers not supporting it
672      * is for example Staging REST endpoint of Sonatype Nexus 2.
673      * This configuration is only about sending (or not sending) HTTP header with content of
674      * <pre>Accept: application/problem+json</pre> that may be required by some servers to trigger error reporting
675      * using RFC 9457.
676      *
677      * @since 2.0.19
678      * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
679      * @configurationType {@link java.lang.Boolean}
680      * @configurationDefaultValue {@link #DEFAULT_HTTP_SEND_RFC9457_ACCEPT}
681      * @configurationRepoIdSuffix Yes
682      */
683     public static final String HTTP_SEND_RFC9457_ACCEPT = PREFIX_TRANSPORT_HTTP + "sendRfc9457Accept";
684 
685     /**
686      * Default value to use if {@link #HTTP_SEND_RFC9457_ACCEPT} is not set: {@code true}.
687      *
688      * @since 2.0.19
689      */
690     public static final boolean DEFAULT_HTTP_SEND_RFC9457_ACCEPT = true;
691 
692     private ConfigurationProperties() {
693         // hide constructor
694     }
695 }