1package org.apache.maven.model.resolution;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122import org.apache.maven.model.Repository;
23import org.apache.maven.model.building.ModelSource;
2425/**26 * Resolves a POM from its coordinates. During the build process, the27 * {@link org.apache.maven.model.building.ModelBuilder} will add any relevant repositories to the model resolver. In28 * other words, the model resolver is stateful and should not be reused across multiple model building requests.29 *30 * @author Benjamin Bentmann31 */32publicinterfaceModelResolver33 {
3435/**36 * Tries to resolve the POM for the specified coordinates.37 *38 * @param groupId The group identifier of the POM, must not be {@code null}.39 * @param artifactId The artifact identifier of the POM, must not be {@code null}.40 * @param version The version of the POM, must not be {@code null}.41 * @return The source of the requested POM, never {@code null}.42 * @throws UnresolvableModelException If the POM could not be resolved from any configured repository.43 */44ModelSource resolveModel( String groupId, String artifactId, String version )
45throws UnresolvableModelException;
4647/**48 * Adds a repository to use for subsequent resolution requests. The order in which repositories are added matters,49 * repositories that were added first should also be searched first. When multiple repositories with the same50 * identifier are added, only the first repository being added will be used.51 *52 * @param repository The repository to add to the internal search chain, must not be {@code null}.53 * @throws InvalidRepositoryException If the repository could not be added (e.g. due to invalid URL or layout).54 */55void addRepository( Repository repository )
56throws InvalidRepositoryException;
5758/**59 * Clones this resolver for usage in a forked resolution process. In general, implementors need not provide a deep60 * clone. The only requirement is that invocations of {@link #addRepository(Repository)} on the clone do not affect61 * the state of the original resolver and vice versa.62 *63 * @return The cloned resolver, never {@code null}.64 */65ModelResolver newCopy();
6667 }