cstamas commented on pull request #24:
URL: 
https://github.com/apache/maven-artifact-transfer/pull/24#issuecomment-830857877


   > I think I know what you've done. Whereas I started with the single jar 
approach, you separated the code into modules.
   > I can't see the new structure, but I know there were sometimes even 3 
implementation due to changes in Aether. How did you solve that?
   
   I found max two implementations (3.0 and 3.0.2) of RepositoryManager, the 
rest was "clean" (one 3.0 and one 3.1). So unsure where there are 3 
implementations...
   
   In short, all the DefaultXXX classes extends this one
   
https://github.com/apache/maven-artifact-transfer/blob/MSHARED-987-providers/maven-artifact-transfer-api/src/main/java/org/apache/maven/shared/transfer/support/DelegatorSupport.java
   
   And Selector (currently very roughly implemented, but we can easily refine 
it once needed for more differentiation)
   
https://github.com/apache/maven-artifact-transfer/blob/MSHARED-987-providers/maven-artifact-transfer-api/src/main/java/org/apache/maven/shared/transfer/support/Selector.java
   
   It uses two key things:
   * SISU: on "collection lookup" (injecting map of components) will silently 
skip components that cannot be loaded due CNFEx (so org.sonatype using things 
will be silently omitted from delegate map in maven 3.1, and other way around, 
org.eclipse using things will be omitted in maven 3.0 (note: this does not 
stand for DIRECT lookup, ie. if you lookup single component by key, and you get 
CNFex, SISU will fail naturally).
   * Selector: then "narrows" and selects "proper" component (by detected 
runtime) from the map
   
   Note: sisu injection of map does NOT instantiate all found components, as 
map is "lazy" (sisu detail), so at the end, you end with ONLY ONE instantiated 
component doing the work for given runtime (components are created atomically 
when they are getted from map).
   
   Re selection: it is simple (only 3.0 vs 3.1) as I found no case of finer 
selection needed (there was 3.0 vs 3.0.2, but we upped 3.0 to 3.0.5). But, if 
needed, we can create fine grained or even hierarchical versioning, and make 
Selector "smarter", but as I said, is currently not needed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to