001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.eclipse.aether.util.graph.manager; 020 021import java.util.Collection; 022 023import org.eclipse.aether.collection.DependencyManager; 024import org.eclipse.aether.graph.Exclusion; 025import org.eclipse.aether.scope.ScopeManager; 026import org.eclipse.aether.scope.SystemDependencyScope; 027 028/** 029 * A dependency manager managing dependencies on all levels supporting transitive dependency management. 030 * <p> 031 * <b>Note:</b>Unlike the {@code ClassicDependencyManager} and the {@code TransitiveDependencyManager} this 032 * implementation applies management also on the first level. This is considered the resolver's default behaviour. 033 * It ignores all management overrides supported by the {@code MavenModelBuilder}. 034 * <p> 035 * This manager has {@code deriveUntil=Integer.MAX_VALUE} and {@code applyFrom=0}. 036 * 037 * @author Christian Schulte 038 * @since 1.4.0 039 */ 040public final class DefaultDependencyManager extends AbstractDependencyManager { 041 /** 042 * Creates a new dependency manager without any management information. 043 * 044 * @deprecated Use constructor that provides consumer application specific predicate. 045 */ 046 @Deprecated 047 public DefaultDependencyManager() { 048 this(null); 049 } 050 051 public DefaultDependencyManager(ScopeManager scopeManager) { 052 super(Integer.MAX_VALUE, 0, scopeManager); 053 } 054 055 @SuppressWarnings("checkstyle:ParameterNumber") 056 private DefaultDependencyManager( 057 int depth, 058 int deriveUntil, 059 int applyFrom, 060 MMap<Key, Holder<String>> managedVersions, 061 MMap<Key, Holder<String>> managedScopes, 062 MMap<Key, Holder<Boolean>> managedOptionals, 063 MMap<Key, Holder<String>> managedLocalPaths, 064 MMap<Key, Collection<Holder<Collection<Exclusion>>>> managedExclusions, 065 SystemDependencyScope systemDependencyScope) { 066 super( 067 depth, 068 deriveUntil, 069 applyFrom, 070 managedVersions, 071 managedScopes, 072 managedOptionals, 073 managedLocalPaths, 074 managedExclusions, 075 systemDependencyScope); 076 } 077 078 @Override 079 protected DependencyManager newInstance( 080 MMap<Key, Holder<String>> managedVersions, 081 MMap<Key, Holder<String>> managedScopes, 082 MMap<Key, Holder<Boolean>> managedOptionals, 083 MMap<Key, Holder<String>> managedLocalPaths, 084 MMap<Key, Collection<Holder<Collection<Exclusion>>>> managedExclusions) { 085 return new DefaultDependencyManager( 086 depth + 1, 087 deriveUntil, 088 applyFrom, 089 managedVersions, 090 managedScopes, 091 managedOptionals, 092 managedLocalPaths, 093 managedExclusions, 094 systemDependencyScope); 095 } 096}