001    /**
002     * Copyright 2010-2012 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.codehaus.mojo.license;
017    
018    import org.apache.maven.artifact.repository.ArtifactRepository;
019    import org.apache.maven.project.MavenProject;
020    
021    import java.util.List;
022    import java.util.SortedMap;
023    
024    /**
025     * A tool to deal with dependencies of a project.
026     *
027     * @author tchemit <chemit@codelutin.com>
028     * @since 1.0
029     */
030    public interface DependenciesTool
031    {
032    
033        /**
034         * For a given {@code project}, obtain the universe of his dependencies after applying transitivity and
035         * filtering rules given in the {@code configuration} object.
036         * <p/>
037         * Result is given in a map where keys are unique artifact id
038         *
039         * @param project            the project to scann
040         * @param configuration      the configuration
041         * @param localRepository    local repository used to resolv dependencies
042         * @param remoteRepositories remote repositories used to resolv dependencies
043         * @param cache              a optional cache where to keep resolved dependencies
044         * @return the map of resolved dependencies indexed by their unique id.
045         * @see MavenProjectDependenciesConfigurator
046         */
047        SortedMap<String, MavenProject> loadProjectDependencies( MavenProject project,
048                                                                 MavenProjectDependenciesConfigurator configuration,
049                                                                 ArtifactRepository localRepository,
050                                                                 List<ArtifactRepository> remoteRepositories,
051                                                                 SortedMap<String, MavenProject> cache );
052    }