org.eclipse.aether.util.graph.manager.ClassicDependencyManager Maven / Gradle / Ivy
Show all versions of maven-resolver-util Show documentation
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.eclipse.aether.util.graph.manager;
import java.util.Collection;
import java.util.Map;
import org.eclipse.aether.collection.DependencyCollectionContext;
import org.eclipse.aether.collection.DependencyManager;
import org.eclipse.aether.graph.Exclusion;
import org.eclipse.aether.scope.ScopeManager;
import org.eclipse.aether.scope.SystemDependencyScope;
/**
* A dependency manager that mimics the way Maven 2.x works. This manager was used throughout all Maven 3.x versions.
*
* This manager has {@code deriveUntil=2} and {@code applyFrom=2}.
*
* Note regarding transitivity: it is broken, and should not be used.
*/
public final class ClassicDependencyManager extends AbstractDependencyManager {
/**
* Creates a new dependency manager without any management information.
*
* @deprecated Use constructor that provides consumer application specific predicate.
*/
@Deprecated
public ClassicDependencyManager() {
this(null);
}
public ClassicDependencyManager(ScopeManager scopeManager) {
this(false, scopeManager);
}
/**
* Creates a new dependency manager without any management information.
*
* @param transitive If true, this manager will collect (derive) until last node on graph. If false,
* it will work as original Maven 3 "classic" dependency manager, collect only up to
* depth of 2.
*
* @since 2.0.0
*/
public ClassicDependencyManager(boolean transitive, ScopeManager scopeManager) {
super(transitive ? Integer.MAX_VALUE : 2, 2, scopeManager);
}
@SuppressWarnings("checkstyle:ParameterNumber")
private ClassicDependencyManager(
int depth,
int deriveUntil,
int applyFrom,
Map