Interface SystemScopeHandler


public interface SystemScopeHandler
In Resolver 1.x line, the "system" scope represented special artifacts. In 2.x resolver testing for this scope is now delegated to consumer application. Class or component that wants to test for this special dependency scope should use this interface, with implementation provided by consumer application.

System is a special scope that tells resolver that dependency is not to be found in any regular repository, so it should not even try to resolve the artifact from them. Dependency in this scope does not have artifact descriptor either. Artifacts in this scope should have the "local path" property set, pointing to a file on local system, where the backing file should reside. Resolution of artifacts in this scope fails, if backing file does not exist (no property set, or property contains invalid path, or the path points to a non-existent file).

Since:
2.0.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final SystemScopeHandler
    The equivalent of Resolver 1.x "system" scope.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns system path string of provided artifact, or null.
    boolean
    Returns true only, if passed in scope label represents "system" scope (as consumer project defines it).
    default boolean
    Returns true if given dependency is in "system" scope.
    default boolean
    isSystemScope(DependencyNode dependencyNode)
    Returns true if given dependency node dependency is in "system" scope.
    void
    setSystemPath(Map<String,String> properties, String systemPath)
    Sets system path in properties.
  • Field Details

  • Method Details

    • isSystemScope

      boolean isSystemScope(String scope)
      Returns true only, if passed in scope label represents "system" scope (as consumer project defines it).
    • isSystemScope

      default boolean isSystemScope(Dependency dependency)
      Returns true if given dependency is in "system" scope.
    • isSystemScope

      default boolean isSystemScope(DependencyNode dependencyNode)
      Returns true if given dependency node dependency is in "system" scope.
    • getSystemPath

      Returns system path string of provided artifact, or null.
      Parameters:
      artifact - The artifact that we want system path from, must not be null.
      Returns:
      the system path from passed in properties, or null if not present.
    • setSystemPath

      void setSystemPath(Map<String,String> properties, String systemPath)
      Sets system path in properties. The passed in systemPath can be null, in which case expected operation is "remove" (or "unset").
      Parameters:
      properties - the properties map, must not be null.
      systemPath - the system path to set (if not null) or unset (if null).