View Javadoc

1   package org.apache.maven.shared.dependency.tree;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.artifact.factory.ArtifactFactory;
23  import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
24  import org.apache.maven.artifact.repository.ArtifactRepository;
25  import org.apache.maven.artifact.resolver.ArtifactCollector;
26  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
27  import org.apache.maven.project.MavenProject;
28  
29  /**
30   * Builds a tree of dependencies for a given Maven project.
31   * 
32   * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
33   * @version $Id: DependencyTreeBuilder.java 661727 2008-05-30 14:21:49Z bentmann $
34   */
35  public interface DependencyTreeBuilder
36  {
37      // fields -----------------------------------------------------------------
38  
39      /**
40       * The plexus role for this component.
41       */
42      String ROLE = DependencyTreeBuilder.class.getName();
43  
44      // public methods ---------------------------------------------------------
45  
46      /**
47       * Builds a tree of dependencies for the specified Maven project.
48       * 
49       * @param project
50       *            the Maven project
51       * @param repository
52       *            the artifact repository to resolve against
53       * @param factory
54       *            the artifact factory to use
55       * @param metadataSource
56       *            the artifact metadata source to use
57       * @param collector
58       *            the artifact collector to use
59       * @return the dependency tree of the specified Maven project
60       * @throws DependencyTreeBuilderException
61       *             if the dependency tree cannot be resolved
62       * @deprecated As of 1.1, replaced by
63       *             {@link #buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)}
64       */
65      DependencyTree buildDependencyTree( MavenProject project, ArtifactRepository repository, ArtifactFactory factory,
66                                          ArtifactMetadataSource metadataSource, ArtifactCollector collector )
67          throws DependencyTreeBuilderException;
68  
69      /**
70       * Builds a tree of dependencies for the specified Maven project.
71       * 
72       * @param project
73       *            the Maven project
74       * @param repository
75       *            the artifact repository to resolve against
76       * @param factory
77       *            the artifact factory to use
78       * @param metadataSource
79       *            the artifact metadata source to use
80       * @param filter
81       *            the artifact filter to use
82       * @param collector
83       *            the artifact collector to use
84       * @return the dependency tree root node of the specified Maven project
85       * @throws DependencyTreeBuilderException
86       *             if the dependency tree cannot be resolved
87       * @since 1.1
88       */
89      DependencyNode buildDependencyTree( MavenProject project, ArtifactRepository repository, ArtifactFactory factory,
90                                          ArtifactMetadataSource metadataSource, ArtifactFilter filter, ArtifactCollector collector )
91          throws DependencyTreeBuilderException;
92  }