From 7bfa4104cafc5c6c57b43497f7ec12892ca211ed Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Fri, 2 Aug 2024 14:00:36 +0200 Subject: [PATCH] [MRESOLVER-585] Explain reason for this method (#548) This method is NOT the "usual" way to introduce new LRM implementation. LRM is special in a sense, is needed early. Proper way is to integrate with LRMProvider instead and tune priorities and/or LocalRepository type strings. --- https://issues.apache.org/jira/browse/MRESOLVER-585 --- .../java/org/eclipse/aether/RepositorySystemSession.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java index f6519209f..0bf8dc56d 100644 --- a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java @@ -194,6 +194,12 @@ interface SessionBuilder { /** * Sets the local repository manager used during this session. Note: Eventually, a valid session must have * a local repository manager set. + *

+ * The provisioning of {@link org.eclipse.aether.repository.LocalRepositoryManager} for use with this + * method introduces chicken and egg situation. Integrators MUST NOT use this method, but instead, hook into + * Local Repository Manager Provider by any means they can (ie by using Provider or Sisu Components) and use + * custom string and/or priorities instead. This method existence is not meant for "everyday use" (normal + * session creation), but for some more advanced use cases. Do not use it, unless you know what are you doing. * * @param localRepositoryManager The local repository manager used during this session, may be {@code null}. * @return This session for chaining, never {@code null}.