code: public static Dependency asDependency(MavenDependencySPI dependency, ArtifactTypeRegistry registry) {
  
          /*
           * Allow for undeclared scopes
           */
          String scope = dependency.getScope().toString();
          if (dependency.isUndeclaredScope()) {
              scope = EMPTY;
          }
          return new Dependency(asArtifact(dependency, registry), scope, dependency.isOptional(),
                  asExclusions(dependency.getExclusions()));
      }
docs: Converts MavenDepedency to Dependency representation used in Aether
  
  @param dependency
  the Maven dependency
  @param registry
  A registry of known artifact types.
  @return the corresponding Aether dependency