View Javadoc

1   /*
2    * #%L
3    * License Maven Plugin
4    *
5    * $Id: DependenciesTool.java 14409 2011-08-10 15:30:41Z tchemit $
6    * $HeadURL: http://svn.codehaus.org/mojo/tags/license-maven-plugin-1.0/src/main/java/org/codehaus/mojo/license/DependenciesTool.java $
7    * %%
8    * Copyright (C) 2011 CodeLutin, Codehaus, Tony Chemit
9    * %%
10   * This program is free software: you can redistribute it and/or modify
11   * it under the terms of the GNU Lesser General Public License as
12   * published by the Free Software Foundation, either version 3 of the
13   * License, or (at your option) any later version.
14   *
15   * This program is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18   * GNU General Lesser Public License for more details.
19   *
20   * You should have received a copy of the GNU General Lesser Public
21   * License along with this program.  If not, see
22   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
23   * #L%
24   */
25  package org.codehaus.mojo.license;
26  
27  import org.apache.maven.artifact.repository.ArtifactRepository;
28  import org.apache.maven.project.MavenProject;
29  
30  import java.util.List;
31  import java.util.SortedMap;
32  
33  /**
34   * A tool to deal with dependencies of a project.
35   *
36   * @author tchemit <chemit@codelutin.com>
37   * @since 1.0
38   */
39  public interface DependenciesTool
40  {
41  
42      /**
43       * For a given {@code project}, obtain the universe of his dependencies after applying transitivity and
44       * filtering rules given in the {@code configuration} object.
45       * <p/>
46       * Result is given in a map where keys are unique artifact id
47       *
48       * @param project            the project to scann
49       * @param configuration      the configuration
50       * @param localRepository    local repository used to resolv dependencies
51       * @param remoteRepositories remote repositories used to resolv dependencies
52       * @param cache              a optional cache where to keep resolved dependencies
53       * @return the map of resolved dependencies indexed by their unique id.
54       * @see MavenProjectDependenciesConfigurator
55       */
56      SortedMap<String, MavenProject> loadProjectDependencies( MavenProject project,
57                                                               MavenProjectDependenciesConfigurator configuration,
58                                                               ArtifactRepository localRepository,
59                                                               List<ArtifactRepository> remoteRepositories,
60                                                               SortedMap<String, MavenProject> cache );
61  }