Class ParentContextDependencyGraphTransformer

java.lang.Object
org.mule.maven.client.internal.GraphCycleAvoidingTransformer
org.mule.maven.client.internal.ParentContextDependencyGraphTransformer
All Implemented Interfaces:
org.eclipse.aether.collection.DependencyGraphTransformer
Direct Known Subclasses:
ApiDependencyGraphTransformer, MulePluginDependencyGraphTransformer

public abstract class ParentContextDependencyGraphTransformer extends GraphCycleAvoidingTransformer
Mark all dependencies that belong to an specific type of parent to prevent the Maven conflict resolution from removing replicates when they belong to different parents.
Since:
1.5.0
  • Constructor Details

    • ParentContextDependencyGraphTransformer

      public ParentContextDependencyGraphTransformer()
  • Method Details

    • transformNode

      protected void transformNode(org.eclipse.aether.graph.DependencyNode node)
      Specified by:
      transformNode in class GraphCycleAvoidingTransformer
    • markChildNode

      protected void markChildNode(org.eclipse.aether.graph.DependencyNode childNode, Optional<org.eclipse.aether.graph.DependencyNode> parent)
    • isSelectableParent

      protected abstract boolean isSelectableParent(org.eclipse.aether.graph.DependencyNode dependencyNode)
      Return true if the node should be selected as parent and all children should be considered in it's context/
      Parameters:
      dependencyNode - the node to evaluate as parent.
      Returns:
      true if the node should be considered as context parent
    • isChildNode

      protected abstract boolean isChildNode(org.eclipse.aether.graph.DependencyNode childNode)
      Returns if the node should be marked as a child node. That means that it belongs to a parent's context
      Parameters:
      childNode - the node to evaluate as child node
      Returns:
      true if the node belongs to a parent context
    • getAncestorKey

      protected abstract String getAncestorKey()
      Key to store ancestors of this node that define it's context
      Returns:
      the key used to store node ancestors
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object