Class NearestConflictResolver

java.lang.Object
org.apache.maven.repository.legacy.resolver.conflict.NearestConflictResolver
All Implemented Interfaces:
ConflictResolver
Direct Known Subclasses:
DefaultConflictResolver

@Named("nearest") @Singleton public class NearestConflictResolver extends Object implements ConflictResolver
Resolves conflicting artifacts by always selecting the nearest declaration. Nearest is defined as the declaration that has the least transitive steps away from the project being built.
Since:
3.0
Author:
Jason van Zyl, Mark Hobson
  • Constructor Details

    • NearestConflictResolver

      public NearestConflictResolver()
  • Method Details

    • resolveConflict

      public ResolutionNode resolveConflict(ResolutionNode node1, ResolutionNode node2)
      Description copied from interface: ConflictResolver
      Determines which of the specified versions of an artifact to use when there are conflicting declarations.
      Specified by:
      resolveConflict in interface ConflictResolver
      Parameters:
      node1 - the first artifact declaration
      node2 - the second artifact declaration
      Returns:
      the artifact declaration to use: node1; node2; or nullif this conflict cannot be resolved