View Javadoc
1   /*******************************************************************************
2    * Copyright (c) 2013, 2014 Sonatype, Inc.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *    Sonatype, Inc. - initial API and implementation
10   *******************************************************************************/
11  package org.eclipse.aether.graph;
12  
13  import java.util.List;
14  
15  /**
16   * A cycle within a dependency graph, that is a sequence of dependencies d_1, d_2, ..., d_n where d_1 and d_n have the
17   * same versionless coordinates. In more practical terms, a cycle occurs when a project directly or indirectly depends
18   * on its own output artifact.
19   * 
20   * @noimplement This interface is not intended to be implemented by clients.
21   * @noextend This interface is not intended to be extended by clients.
22   */
23  public interface DependencyCycle
24  {
25  
26      /**
27       * Gets the dependencies that lead to the first dependency on the cycle, starting from the root of the dependency
28       * graph.
29       * 
30       * @return The (read-only) sequence of dependencies that precedes the cycle in the graph, potentially empty but
31       *         never {@code null}.
32       */
33      List<Dependency> getPrecedingDependencies();
34  
35      /**
36       * Gets the dependencies that actually form the cycle. For example, a -&gt; b -&gt; c -&gt; a, i.e. the last
37       * dependency in this sequence duplicates the first element and closes the cycle. Hence the length of the cycle is
38       * the size of the returned sequence minus 1.
39       * 
40       * @return The (read-only) sequence of dependencies that forms the cycle, never {@code null}.
41       */
42      List<Dependency> getCyclicDependencies();
43  
44  }