cstamas commented on code in PR #1794: URL: https://github.com/apache/maven-resolver/pull/1794#discussion_r2798402103
########## src/site/markdown/how-resolver-works.md: ########## @@ -0,0 +1,131 @@ +# How Resolver Works +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +Maven Artifact Resolver (former Aether) is central piece of Maven, and thus, +is many times target of questions and curiosity how it actually works under the hood. +This document tries to shed some light on this topic, and explain the main concepts +and building blocks of Resolver. + +One important aspect of Resolver is that itself, alone is "incomplete". Integrating application, like Maven is +the one that provides the "glue" (models) and logic how to resolve versions, ranges, build effective models. +Hence, Resolver itself, alone is unusable. To make it usable, one needs to complement it with models and +implementations of missing components. Historically, Maven module completing Resolver is the +`org.apache.maven:maven-resolver-provider` module. + +## Core Concepts + +At the core of Resolver lies the concept of **artifacts** and **repositories**. An artifact is basically a +"symbolic coordinate" of some content. Usually it is a JAR, but it can be really anything, as long as it is +"addressable" using Maven coordinates: `<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>` (default value of +`extension` is `jar`, and default value for `classifier` is `""`, empty string). Repositories +are places where artifacts are stored and from where they can be retrieved. Resolver by default operates +with one local repository (usually a directory on local filesystem) and zero or more remote repositories. + +The term "resolving" is a bit overloaded, but in general it involves following steps: +* **dependency graph collection** builds the "dependency graph" Review Comment: No, this is a _graph_, not a list. Is not even a tree, as it may have cycles. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
