diff --git a/maven-resolver-api/pom.xml b/maven-resolver-api/pom.xml index 9298d4562..cc50042bf 100644 --- a/maven-resolver-api/pom.xml +++ b/maven-resolver-api/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-api diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java index 054bfe01b..42ecc2585 100644 --- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java @@ -27,7 +27,7 @@ /** * The management updates to apply to a dependency. - * + * * @see DependencyManager#manageDependency(Dependency) */ public final class DependencyManagement @@ -35,27 +35,53 @@ public final class DependencyManagement private String version; + /** + * @since 1.2.0 + */ + private String versionSourceHint; + private String scope; + /** + * @since 1.2.0 + */ + private String scopeSourceHint; + private Boolean optional; + /** + * @since 1.2.0 + */ + private String optionalSourceHint; + private Collection exclusions; + /** + * @since 1.2.0 + */ + private String exclusionsSourceHint; + private Map properties; + /** + * @since 1.2.0 + */ + private String propertiesSourceHint; + /** * Creates an empty management update. */ public DependencyManagement() { // enables default constructor + super(); } /** * Gets the new version to apply to the dependency. - * + * * @return The new version or {@code null} if the version is not managed and the existing dependency version should - * remain unchanged. + * remain unchanged. */ public String getVersion() { @@ -64,7 +90,7 @@ public String getVersion() /** * Sets the new version to apply to the dependency. - * + * * @param version The new version, may be {@code null} if the version is not managed. * @return This management update for chaining, never {@code null}. */ @@ -74,11 +100,33 @@ public DependencyManagement setVersion( String version ) return this; } + /** + * Gets an informational hint describing the source declaring the version management. + * @return An informational hint describing the source declaring the version management or {@code null}. + * @since 1.2.0 + */ + public String getVersionSourceHint() + { + return this.versionSourceHint; + } + + /** + * Sets the informational hint describing the source declaring the version management. + * @param value The new informational hint decsribing the source declaring the version management or {@code null}. + * @return This management update for chaining, never {@code null}. + * @since 1.2.0 + */ + public DependencyManagement setVersionSourceHint( final String value ) + { + this.versionSourceHint = value; + return this; + } + /** * Gets the new scope to apply to the dependency. - * + * * @return The new scope or {@code null} if the scope is not managed and the existing dependency scope should remain - * unchanged. + * unchanged. */ public String getScope() { @@ -87,7 +135,7 @@ public String getScope() /** * Sets the new scope to apply to the dependency. - * + * * @param scope The new scope, may be {@code null} if the scope is not managed. * @return This management update for chaining, never {@code null}. */ @@ -97,11 +145,33 @@ public DependencyManagement setScope( String scope ) return this; } + /** + * Gets an informational hint describing the source declaring the scope management. + * @return An informational hint describing the source declaring the scope management or {@code null}. + * @since 1.2.0 + */ + public String getScopeSourceHint() + { + return this.scopeSourceHint; + } + + /** + * Sets the informational hint describing the source declaring the scope management. + * @param value The new informational hint decsribing the source declaring the scope management or {@code null}. + * @return This management update for chaining, never {@code null}. + * @since 1.2.0 + */ + public DependencyManagement setScopeSourceHint( final String value ) + { + this.scopeSourceHint = value; + return this; + } + /** * Gets the new optional flag to apply to the dependency. - * + * * @return The new optional flag or {@code null} if the flag is not managed and the existing optional flag of the - * dependency should remain unchanged. + * dependency should remain unchanged. */ public Boolean getOptional() { @@ -110,7 +180,7 @@ public Boolean getOptional() /** * Sets the new optional flag to apply to the dependency. - * + * * @param optional The optional flag, may be {@code null} if the flag is not managed. * @return This management update for chaining, never {@code null}. */ @@ -120,13 +190,36 @@ public DependencyManagement setOptional( Boolean optional ) return this; } + /** + * Gets an informational hint describing the source declaring the optionality management. + * @return An informational hint describing the source declaring the optionality management or {@code null}. + * @since 1.2.0 + */ + public String getOptionalitySourceHint() + { + return this.optionalSourceHint; + } + + /** + * Sets the informational hint describing the source declaring the optionality management. + * @param value The new informational hint decsribing the source declaring the optionality management or + * {@code null}. + * @return This management update for chaining, never {@code null}. + * @since 1.2.0 + */ + public DependencyManagement setOptionalitySourceHint( final String value ) + { + this.optionalSourceHint = value; + return this; + } + /** * Gets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of * exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged * with information from dependency management or overridden by it. - * + * * @return The new exclusions or {@code null} if the exclusions are not managed and the existing dependency - * exclusions should remain unchanged. + * exclusions should remain unchanged. */ public Collection getExclusions() { @@ -137,7 +230,7 @@ public Collection getExclusions() * Sets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of * exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged * with information from dependency management or overridden by it. - * + * * @param exclusions The new exclusions, may be {@code null} if the exclusions are not managed. * @return This management update for chaining, never {@code null}. */ @@ -147,13 +240,36 @@ public DependencyManagement setExclusions( Collection exclusions ) return this; } + /** + * Gets an informational hint describing the source declaring the exclusions management. + * @return An informational hint describing the source declaring the exclusions management or {@code null}. + * @since 1.2.0 + */ + public String getExclusionsSourceHint() + { + return this.exclusionsSourceHint; + } + + /** + * Sets the informational hint describing the source declaring the exclusions management. + * @param value The new informational hint decsribing the source declaring the exclusions management or + * {@code null}. + * @return This management update for chaining, never {@code null}. + * @since 1.2.0 + */ + public DependencyManagement setExclusionsSourceHint( final String value ) + { + this.exclusionsSourceHint = value; + return this; + } + /** * Gets the new properties to apply to the dependency. Note that this map denotes the complete set of properties, * i.e. the dependency manager controls whether any existing properties get merged with the information from * dependency management or overridden by it. - * + * * @return The new artifact properties or {@code null} if the properties are not managed and the existing properties - * should remain unchanged. + * should remain unchanged. */ public Map getProperties() { @@ -164,7 +280,7 @@ public Map getProperties() * Sets the new properties to apply to the dependency. Note that this map denotes the complete set of properties, * i.e. the dependency manager controls whether any existing properties get merged with the information from * dependency management or overridden by it. - * + * * @param properties The new artifact properties, may be {@code null} if the properties are not managed. * @return This management update for chaining, never {@code null}. */ @@ -174,4 +290,27 @@ public DependencyManagement setProperties( Map properties ) return this; } + /** + * Gets an informational hint describing the source declaring the properties management. + * @return An informational hint describing the source declaring the properties management or {@code null}. + * @since 1.2.0 + */ + public String getPropertiesSourceHint() + { + return this.propertiesSourceHint; + } + + /** + * Sets the informational hint describing the source declaring the properties management. + * @param value The new informational hint decsribing the source declaring the properties management or + * {@code null}. + * @return This management update for chaining, never {@code null}. + * @since 1.2.0 + */ + public DependencyManagement setPropertiesSourceHint( final String value ) + { + this.propertiesSourceHint = value; + return this; + } + } diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java index 2e1a78b6f..d4861c94d 100644 --- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java @@ -45,9 +45,14 @@ public final class Dependency private final Set exclusions; + /** + * @since 1.2.0 + */ + private final String sourceHint; + /** * Creates a mandatory dependency on the specified artifact with the given scope. - * + * * @param artifact The artifact being depended on, must not be {@code null}. * @param scope The scope of the dependency, may be {@code null}. */ @@ -58,7 +63,7 @@ public Dependency( Artifact artifact, String scope ) /** * Creates a dependency on the specified artifact with the given scope. - * + * * @param artifact The artifact being depended on, must not be {@code null}. * @param scope The scope of the dependency, may be {@code null}. * @param optional A flag whether the dependency is optional or mandatory, may be {@code null}. @@ -70,7 +75,7 @@ public Dependency( Artifact artifact, String scope, Boolean optional ) /** * Creates a dependency on the specified artifact with the given scope and exclusions. - * + * * @param artifact The artifact being depended on, must not be {@code null}. * @param scope The scope of the dependency, may be {@code null}. * @param optional A flag whether the dependency is optional or mandatory, may be {@code null}. @@ -78,21 +83,65 @@ public Dependency( Artifact artifact, String scope, Boolean optional ) */ public Dependency( Artifact artifact, String scope, Boolean optional, Collection exclusions ) { - this( artifact, scope, Exclusions.copy( exclusions ), optional ); + this( null, artifact, scope, Exclusions.copy( exclusions ), optional ); + } + + /** + * Creates a dependency on the specified artifact. + * + * @param sourceHint An informational hint describing the source declaring the dependency, may be {@code null}. + * @param artifact The artifact being depended on, must not be {@code null}. + * @param scope The scope of the dependency, may be {@code null}. + * @param optional A flag whether the dependency is optional or mandatory, may be {@code null}. + * @param exclusions The exclusions that apply to transitive dependencies, may be {@code null} if none. + * @since 1.2.0 + */ + public Dependency( String sourceHint, Artifact artifact, String scope, Boolean optional, + Collection exclusions ) + { + this( sourceHint, artifact, scope, Exclusions.copy( exclusions ), optional ); } - private Dependency( Artifact artifact, String scope, Set exclusions, Boolean optional ) + private Dependency( String sourceHint, Artifact artifact, String scope, Set exclusions, + Boolean optional ) { // NOTE: This constructor assumes immutability of the provided exclusion collection, for internal use only this.artifact = requireNonNull( artifact, "artifact cannot be null" ); this.scope = ( scope != null ) ? scope : ""; this.optional = optional; this.exclusions = exclusions; + this.sourceHint = sourceHint; + } + + /** + * Gets an informational hint describing the source declaring the dependency. + * + * @return An informational hint describing the source declaring the dependency or {@code null}. + * @since 1.2.0 + */ + public String getSourceHint() + { + return this.sourceHint; + } + + /** + * Sets the informational hint describing the source declaring the dependency. + * @param value The new informational hint describing the source declaring the dependency or {@code null}. + * @return The new dependency, never {@code null}. + * @since 1.2.0 + */ + public Dependency setSourceHint( final String value ) + { + return ( this.sourceHint != null && this.sourceHint.equals( value ) ) + || ( this.sourceHint == value ) + ? this + : new Dependency( value, artifact, scope, exclusions, optional ); + } /** * Gets the artifact being depended on. - * + * * @return The artifact, never {@code null}. */ public Artifact getArtifact() @@ -102,7 +151,7 @@ public Artifact getArtifact() /** * Sets the artifact being depended on. - * + * * @param artifact The artifact, must not be {@code null}. * @return The new dependency, never {@code null}. */ @@ -112,12 +161,12 @@ public Dependency setArtifact( Artifact artifact ) { return this; } - return new Dependency( artifact, scope, exclusions, optional ); + return new Dependency( sourceHint, artifact, scope, exclusions, optional ); } /** * Gets the scope of the dependency. The scope defines in which context this dependency is relevant. - * + * * @return The scope or an empty string if not set, never {@code null}. */ public String getScope() @@ -127,7 +176,7 @@ public String getScope() /** * Sets the scope of the dependency, e.g. "compile". - * + * * @param scope The scope of the dependency, may be {@code null}. * @return The new dependency, never {@code null}. */ @@ -137,12 +186,12 @@ public Dependency setScope( String scope ) { return this; } - return new Dependency( artifact, scope, exclusions, optional ); + return new Dependency( sourceHint, artifact, scope, exclusions, optional ); } /** * Indicates whether this dependency is optional or not. Optional dependencies can be ignored in some contexts. - * + * * @return {@code true} if the dependency is (definitively) optional, {@code false} otherwise. */ public boolean isOptional() @@ -153,7 +202,7 @@ public boolean isOptional() /** * Gets the optional flag for the dependency. Note: Most clients will usually call {@link #isOptional()} to * determine the optional flag, this method is for advanced use cases where three-valued logic is required. - * + * * @return The optional flag or {@code null} if unspecified. */ public Boolean getOptional() @@ -163,9 +212,9 @@ public Boolean getOptional() /** * Sets the optional flag for the dependency. - * + * * @param optional {@code true} if the dependency is optional, {@code false} if the dependency is mandatory, may be - * {@code null} if unspecified. + * {@code null} if unspecified. * @return The new dependency, never {@code null}. */ public Dependency setOptional( Boolean optional ) @@ -174,13 +223,13 @@ public Dependency setOptional( Boolean optional ) { return this; } - return new Dependency( artifact, scope, exclusions, optional ); + return new Dependency( sourceHint, artifact, scope, exclusions, optional ); } /** * Gets the exclusions for this dependency. Exclusions can be used to remove transitive dependencies during * resolution. - * + * * @return The (read-only) exclusions, never {@code null}. */ public Collection getExclusions() @@ -190,7 +239,7 @@ public Collection getExclusions() /** * Sets the exclusions for the dependency. - * + * * @param exclusions The exclusions, may be {@code null}. * @return The new dependency, never {@code null}. */ @@ -200,7 +249,7 @@ public Dependency setExclusions( Collection exclusions ) { return this; } - return new Dependency( artifact, scope, optional, exclusions ); + return new Dependency( sourceHint, artifact, scope, optional, exclusions ); } private boolean hasEquivalentExclusions( Collection exclusions ) @@ -214,7 +263,7 @@ private boolean hasEquivalentExclusions( Collection exclusions ) return this.exclusions.equals( exclusions ); } return exclusions.size() >= this.exclusions.size() && this.exclusions.containsAll( exclusions ) - && exclusions.containsAll( this.exclusions ); + && exclusions.containsAll( this.exclusions ); } @Override @@ -238,7 +287,7 @@ else if ( obj == null || !getClass().equals( obj.getClass() ) ) Dependency that = (Dependency) obj; return artifact.equals( that.artifact ) && scope.equals( that.scope ) && eq( optional, that.optional ) - && exclusions.equals( that.exclusions ); + && exclusions.equals( that.exclusions ); } private static boolean eq( T o1, T o2 ) @@ -278,7 +327,7 @@ private Exclusions( Collection exclusions ) { exclusions = new LinkedHashSet( exclusions ); } - this.exclusions = exclusions.toArray( new Exclusion[exclusions.size()] ); + this.exclusions = exclusions.toArray( new Exclusion[ exclusions.size() ] ); } @Override diff --git a/maven-resolver-connector-basic/pom.xml b/maven-resolver-connector-basic/pom.xml index 5633967e9..87b5d7786 100644 --- a/maven-resolver-connector-basic/pom.xml +++ b/maven-resolver-connector-basic/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-connector-basic diff --git a/maven-resolver-demos/maven-resolver-demo-maven-plugin/pom.xml b/maven-resolver-demos/maven-resolver-demo-maven-plugin/pom.xml index 1b5c0700d..44a209322 100644 --- a/maven-resolver-demos/maven-resolver-demo-maven-plugin/pom.xml +++ b/maven-resolver-demos/maven-resolver-demo-maven-plugin/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver-demos - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-demo-maven-plugin diff --git a/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml b/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml index d70901530..325012898 100644 --- a/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml +++ b/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver-demos - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-demo-snippets diff --git a/maven-resolver-demos/pom.xml b/maven-resolver-demos/pom.xml index 0a9ed508a..dc3abcbf6 100644 --- a/maven-resolver-demos/pom.xml +++ b/maven-resolver-demos/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-demos diff --git a/maven-resolver-impl/pom.xml b/maven-resolver-impl/pom.xml index 6c52bf92f..ae90d91ff 100644 --- a/maven-resolver-impl/pom.xml +++ b/maven-resolver-impl/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-impl diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java index 074b83c60..2e678402f 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java @@ -124,7 +124,8 @@ public DefaultDependencyCollector setLoggerFactory( LoggerFactory loggerFactory public DefaultDependencyCollector setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) { - this.remoteRepositoryManager = requireNonNull( remoteRepositoryManager, "remote repository provider cannot be null" ); + this.remoteRepositoryManager = requireNonNull( remoteRepositoryManager, + "remote repository provider cannot be null" ); return this; } @@ -704,8 +705,8 @@ static class Args final CollectRequest request; Args( RepositorySystemSession session, RequestTrace trace, DataPool pool, NodeStack nodes, - DefaultDependencyCollectionContext collectionContext, DefaultVersionFilterContext versionContext, - CollectRequest request ) + DefaultDependencyCollectionContext collectionContext, DefaultVersionFilterContext versionContext, + CollectRequest request ) { this.session = session; this.request = request; @@ -783,43 +784,77 @@ static class PremanagedDependency final String premanagedVersion; + /** + * @since 1.2.0 + */ + final String versionManagementSourceHint; + final String premanagedScope; + /** + * @since 1.2.0 + */ + final String scopeManagementSourceHint; + final Boolean premanagedOptional; + /** + * @since 1.2.0 + */ + final String optionalityManagementSourceHint; + /** * @since 1.1.0 */ final Collection premanagedExclusions; + /** + * @since 1.2.0 + */ + final String exclusionsManagementSourceHint; + /** * @since 1.1.0 */ final Map premanagedProperties; + /** + * @since 1.2.0 + */ + final String propertiesManagementSourceHint; + final int managedBits; final Dependency managedDependency; final boolean premanagedState; - PremanagedDependency( String premanagedVersion, String premanagedScope, Boolean premanagedOptional, - Collection premanagedExclusions, Map premanagedProperties, + PremanagedDependency( String premanagedVersion, String versionManagementSourceHint, + String premanagedScope, String scopeManagementSourceHint, + Boolean premanagedOptional, String optionalityManagementSourceHint, + Collection premanagedExclusions, String exclusionsManagementSourceHint, + Map premanagedProperties, String propertiesManagementSourceHint, int managedBits, Dependency managedDependency, boolean premanagedState ) { this.premanagedVersion = premanagedVersion; + this.versionManagementSourceHint = versionManagementSourceHint; this.premanagedScope = premanagedScope; + this.scopeManagementSourceHint = scopeManagementSourceHint; this.premanagedOptional = premanagedOptional; + this.optionalityManagementSourceHint = optionalityManagementSourceHint; this.premanagedExclusions = premanagedExclusions != null ? Collections.unmodifiableCollection( new ArrayList( premanagedExclusions ) ) : null; + this.exclusionsManagementSourceHint = exclusionsManagementSourceHint; + this.premanagedProperties = premanagedProperties != null ? Collections.unmodifiableMap( new HashMap( premanagedProperties ) ) : null; + this.propertiesManagementSourceHint = propertiesManagementSourceHint; this.managedBits = managedBits; this.managedDependency = managedDependency; this.premanagedState = premanagedState; @@ -832,10 +867,15 @@ static PremanagedDependency create( DependencyManager depManager, Dependency dep int managedBits = 0; String premanagedVersion = null; + String versionSourceHint = null; String premanagedScope = null; + String scopeSourceHint = null; Boolean premanagedOptional = null; + String optionalitySourceHint = null; Collection premanagedExclusions = null; + String exclusionsSourceHint = null; Map premanagedProperties = null; + String propertiesSourceHint = null; if ( depMngt != null ) { @@ -843,6 +883,7 @@ static PremanagedDependency create( DependencyManager depManager, Dependency dep { Artifact artifact = dependency.getArtifact(); premanagedVersion = artifact.getVersion(); + versionSourceHint = depMngt.getVersionSourceHint(); dependency = dependency.setArtifact( artifact.setVersion( depMngt.getVersion() ) ); managedBits |= DependencyNode.MANAGED_VERSION; } @@ -850,30 +891,38 @@ static PremanagedDependency create( DependencyManager depManager, Dependency dep { Artifact artifact = dependency.getArtifact(); premanagedProperties = artifact.getProperties(); + propertiesSourceHint = depMngt.getPropertiesSourceHint(); dependency = dependency.setArtifact( artifact.setProperties( depMngt.getProperties() ) ); managedBits |= DependencyNode.MANAGED_PROPERTIES; } if ( depMngt.getScope() != null ) { premanagedScope = dependency.getScope(); + scopeSourceHint = depMngt.getScopeSourceHint(); dependency = dependency.setScope( depMngt.getScope() ); managedBits |= DependencyNode.MANAGED_SCOPE; } if ( depMngt.getOptional() != null ) { premanagedOptional = dependency.isOptional(); + optionalitySourceHint = depMngt.getOptionalitySourceHint(); dependency = dependency.setOptional( depMngt.getOptional() ); managedBits |= DependencyNode.MANAGED_OPTIONAL; } if ( depMngt.getExclusions() != null ) { premanagedExclusions = dependency.getExclusions(); + exclusionsSourceHint = depMngt.getExclusionsSourceHint(); dependency = dependency.setExclusions( depMngt.getExclusions() ); managedBits |= DependencyNode.MANAGED_EXCLUSIONS; } } - return new PremanagedDependency( premanagedVersion, premanagedScope, premanagedOptional, - premanagedExclusions, premanagedProperties, managedBits, dependency, + return new PremanagedDependency( premanagedVersion, versionSourceHint, + premanagedScope, scopeSourceHint, + premanagedOptional, optionalitySourceHint, + premanagedExclusions, exclusionsSourceHint, + premanagedProperties, propertiesSourceHint, + managedBits, dependency, premanagedState ); } @@ -884,10 +933,25 @@ public void applyTo( DefaultDependencyNode child ) if ( premanagedState ) { child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_VERSION, premanagedVersion ); + child.setData( DependencyManagerUtils.NODE_DATA_VERSION_MANAGEMENT_SOURCE_HINT, + versionManagementSourceHint ); + child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_SCOPE, premanagedScope ); + child.setData( DependencyManagerUtils.NODE_DATA_SCOPE_MANAGEMENT_SOURCE_HINT, + scopeManagementSourceHint ); + child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_OPTIONAL, premanagedOptional ); + child.setData( DependencyManagerUtils.NODE_DATA_OPTIONALITY_MANAGEMENT_SOURCE_HINT, + optionalityManagementSourceHint ); + child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_EXCLUSIONS, premanagedExclusions ); + child.setData( DependencyManagerUtils.NODE_DATA_EXCLUSIONS_MANAGEMENT_SOURCE_HINT, + exclusionsManagementSourceHint ); + child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_PROPERTIES, premanagedProperties ); + child.setData( DependencyManagerUtils.NODE_DATA_PROPERTIES_MANAGEMENT_SOURCE_HINT, + propertiesManagementSourceHint ); + } } diff --git a/maven-resolver-spi/pom.xml b/maven-resolver-spi/pom.xml index 6754b17ba..e67b7766e 100644 --- a/maven-resolver-spi/pom.xml +++ b/maven-resolver-spi/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-spi diff --git a/maven-resolver-test-util/pom.xml b/maven-resolver-test-util/pom.xml index e8e274bc0..40b8c7230 100644 --- a/maven-resolver-test-util/pom.xml +++ b/maven-resolver-test-util/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-test-util diff --git a/maven-resolver-transport-classpath/pom.xml b/maven-resolver-transport-classpath/pom.xml index d0d7159a0..83af17e2c 100644 --- a/maven-resolver-transport-classpath/pom.xml +++ b/maven-resolver-transport-classpath/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-transport-classpath diff --git a/maven-resolver-transport-file/pom.xml b/maven-resolver-transport-file/pom.xml index c020beda0..0505eb436 100644 --- a/maven-resolver-transport-file/pom.xml +++ b/maven-resolver-transport-file/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-transport-file diff --git a/maven-resolver-transport-http/pom.xml b/maven-resolver-transport-http/pom.xml index f1bae2559..602f260b2 100644 --- a/maven-resolver-transport-http/pom.xml +++ b/maven-resolver-transport-http/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-transport-http diff --git a/maven-resolver-transport-wagon/pom.xml b/maven-resolver-transport-wagon/pom.xml index a513f32b3..c2cecfaa9 100644 --- a/maven-resolver-transport-wagon/pom.xml +++ b/maven-resolver-transport-wagon/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-transport-wagon diff --git a/maven-resolver-util/pom.xml b/maven-resolver-util/pom.xml index de5bdb1f7..37202805a 100644 --- a/maven-resolver-util/pom.xml +++ b/maven-resolver-util/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-resolver-util diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java index 88c5d62d0..4273a9de5 100644 --- a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java @@ -45,14 +45,39 @@ public final class ClassicDependencyManager private final Map managedVersions; + /** + * @since 1.2.0 + */ + private final Map managedVersionsSourceHints; + private final Map managedScopes; + /** + * @since 1.2.0 + */ + private final Map managedScopesSourceHints; + private final Map managedOptionals; + /** + * @since 1.2.0 + */ + private final Map managedOptionalsSourceHints; + private final Map managedLocalPaths; + /** + * @since 1.2.0 + */ + private final Map managedLocalPathsSourceHints; + private final Map> managedExclusions; + /** + * @since 1.2.0 + */ + private final Map> managedExclusionsSourceHints; + private int hashCode; /** @@ -61,21 +86,37 @@ public final class ClassicDependencyManager public ClassicDependencyManager() { this( 0, Collections.emptyMap(), Collections.emptyMap(), + Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), - Collections.>emptyMap() ); + Collections.emptyMap(), Collections.emptyMap(), + Collections.>emptyMap(), + Collections.>emptyMap() ); } - private ClassicDependencyManager( int depth, Map managedVersions, - Map managedScopes, Map managedOptionals, + private ClassicDependencyManager( int depth, + Map managedVersions, + Map managedVersionsSourceHints, + Map managedScopes, + Map managedScopesSourceHints, + Map managedOptionals, + Map managedOptionalsSourceHints, Map managedLocalPaths, - Map> managedExclusions ) + Map managedLocalPathsSourceHints, + Map> managedExclusions, + Map> managedExclusionsSourceHints ) { + super(); this.depth = depth; this.managedVersions = managedVersions; + this.managedVersionsSourceHints = managedVersionsSourceHints; this.managedScopes = managedScopes; + this.managedScopesSourceHints = managedScopesSourceHints; this.managedOptionals = managedOptionals; + this.managedOptionalsSourceHints = managedOptionalsSourceHints; this.managedLocalPaths = managedLocalPaths; + this.managedLocalPathsSourceHints = managedLocalPathsSourceHints; this.managedExclusions = managedExclusions; + this.managedExclusionsSourceHints = managedExclusionsSourceHints; } public DependencyManager deriveChildManager( DependencyCollectionContext context ) @@ -86,15 +127,23 @@ public DependencyManager deriveChildManager( DependencyCollectionContext context } else if ( depth == 1 ) { - return new ClassicDependencyManager( depth + 1, managedVersions, managedScopes, managedOptionals, - managedLocalPaths, managedExclusions ); + return new ClassicDependencyManager( depth + 1, managedVersions, managedVersionsSourceHints, + managedScopes, managedScopesSourceHints, + managedOptionals, managedOptionalsSourceHints, + managedLocalPaths, managedLocalPathsSourceHints, + managedExclusions, managedExclusionsSourceHints ); } - Map managedVersions = this.managedVersions; - Map managedScopes = this.managedScopes; - Map managedOptionals = this.managedOptionals; - Map managedLocalPaths = this.managedLocalPaths; - Map> managedExclusions = this.managedExclusions; + Map versions = this.managedVersions; + Map versionsSourceHints = this.managedVersionsSourceHints; + Map scopes = this.managedScopes; + Map scopesSourceHints = this.managedScopesSourceHints; + Map optionals = this.managedOptionals; + Map optionalsSourceHints = this.managedOptionalsSourceHints; + Map localPaths = this.managedLocalPaths; + Map localPathsSourceHints = this.managedLocalPathsSourceHints; + Map> exclusions = this.managedExclusions; + Map> exclusionsSourceHints = this.managedExclusionsSourceHints; for ( Dependency managedDependency : context.getManagedDependencies() ) { @@ -102,64 +151,86 @@ else if ( depth == 1 ) Object key = getKey( artifact ); String version = artifact.getVersion(); - if ( version.length() > 0 && !managedVersions.containsKey( key ) ) + if ( version.length() > 0 && !versions.containsKey( key ) ) { - if ( managedVersions == this.managedVersions ) + if ( versions == this.managedVersions ) { - managedVersions = new HashMap( this.managedVersions ); + versions = new HashMap( this.managedVersions ); + versionsSourceHints = new HashMap( this.managedVersionsSourceHints ); } - managedVersions.put( key, version ); + versions.put( key, version ); + versionsSourceHints.put( key, managedDependency.getSourceHint() ); } String scope = managedDependency.getScope(); - if ( scope.length() > 0 && !managedScopes.containsKey( key ) ) + if ( scope.length() > 0 && !scopes.containsKey( key ) ) { - if ( managedScopes == this.managedScopes ) + if ( scopes == this.managedScopes ) { - managedScopes = new HashMap( this.managedScopes ); + scopes = new HashMap( this.managedScopes ); + scopesSourceHints = new HashMap( this.managedScopesSourceHints ); } - managedScopes.put( key, scope ); + scopes.put( key, scope ); + scopesSourceHints.put( key, managedDependency.getSourceHint() ); } Boolean optional = managedDependency.getOptional(); - if ( optional != null && !managedOptionals.containsKey( key ) ) + if ( optional != null && !optionals.containsKey( key ) ) { - if ( managedOptionals == this.managedOptionals ) + if ( optionals == this.managedOptionals ) { - managedOptionals = new HashMap( this.managedOptionals ); + optionals = new HashMap( this.managedOptionals ); + optionalsSourceHints = new HashMap( this.managedOptionalsSourceHints ); } - managedOptionals.put( key, optional ); + optionals.put( key, optional ); + optionalsSourceHints.put( key, managedDependency.getSourceHint() ); } String localPath = managedDependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ); - if ( localPath != null && !managedLocalPaths.containsKey( key ) ) + if ( localPath != null && !localPaths.containsKey( key ) ) { - if ( managedLocalPaths == this.managedLocalPaths ) + if ( localPaths == this.managedLocalPaths ) { - managedLocalPaths = new HashMap( this.managedLocalPaths ); + localPaths = new HashMap( this.managedLocalPaths ); + localPathsSourceHints = new HashMap( this.managedLocalPathsSourceHints ); } - managedLocalPaths.put( key, localPath ); + localPaths.put( key, localPath ); + localPathsSourceHints.put( key, managedDependency.getSourceHint() ); } - Collection exclusions = managedDependency.getExclusions(); - if ( !exclusions.isEmpty() ) + if ( !managedDependency.getExclusions().isEmpty() ) { - if ( managedExclusions == this.managedExclusions ) + if ( exclusions == this.managedExclusions ) { - managedExclusions = new HashMap>( this.managedExclusions ); + exclusions = new HashMap>( this.managedExclusions ); + exclusionsSourceHints = new HashMap>( this.managedExclusionsSourceHints ); } - Collection managed = managedExclusions.get( key ); + Collection managed = exclusions.get( key ); if ( managed == null ) { managed = new LinkedHashSet(); - managedExclusions.put( key, managed ); + exclusions.put( key, managed ); + } + managed.addAll( managedDependency.getExclusions() ); + + Collection managedSourceHints = exclusionsSourceHints.get( key ); + if ( managedSourceHints == null ) + { + managedSourceHints = new LinkedHashSet(); + exclusionsSourceHints.put( key, managedSourceHints ); } - managed.addAll( exclusions ); + + managedSourceHints.add( managedDependency.getSourceHint() ); } } - return new ClassicDependencyManager( depth + 1, managedVersions, managedScopes, managedOptionals, - managedLocalPaths, managedExclusions ); + return new ClassicDependencyManager( depth + 1, + versions, versionsSourceHints, + scopes, scopesSourceHints, + optionals, optionalsSourceHints, + localPaths, localPathsSourceHints, + exclusions, exclusionsSourceHints ); + } public DependencyManagement manageDependency( Dependency dependency ) @@ -178,6 +249,7 @@ public DependencyManagement manageDependency( Dependency dependency ) management = new DependencyManagement(); } management.setVersion( version ); + management.setVersionSourceHint( this.managedVersionsSourceHints.get( key ) ); } String scope = managedScopes.get( key ); @@ -188,19 +260,21 @@ public DependencyManagement manageDependency( Dependency dependency ) management = new DependencyManagement(); } management.setScope( scope ); + management.setScopeSourceHint( this.managedScopesSourceHints.get( key ) ); if ( !JavaScopes.SYSTEM.equals( scope ) - && dependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) != null ) + && dependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) != null ) { Map properties = new HashMap( dependency.getArtifact().getProperties() ); properties.remove( ArtifactProperties.LOCAL_PATH ); management.setProperties( properties ); + management.setPropertiesSourceHint( this.managedScopesSourceHints.get( key ) ); } } if ( ( scope != null && JavaScopes.SYSTEM.equals( scope ) ) - || ( scope == null && JavaScopes.SYSTEM.equals( dependency.getScope() ) ) ) + || ( scope == null && JavaScopes.SYSTEM.equals( dependency.getScope() ) ) ) { String localPath = managedLocalPaths.get( key ); if ( localPath != null ) @@ -213,6 +287,7 @@ public DependencyManagement manageDependency( Dependency dependency ) new HashMap( dependency.getArtifact().getProperties() ); properties.put( ArtifactProperties.LOCAL_PATH, localPath ); management.setProperties( properties ); + management.setPropertiesSourceHint( this.managedLocalPathsSourceHints.get( key ) ); } } @@ -224,6 +299,7 @@ public DependencyManagement manageDependency( Dependency dependency ) management = new DependencyManagement(); } management.setOptional( optional ); + management.setOptionalitySourceHint( this.managedOptionalsSourceHints.get( key ) ); } } @@ -237,6 +313,12 @@ public DependencyManagement manageDependency( Dependency dependency ) Collection result = new LinkedHashSet( dependency.getExclusions() ); result.addAll( exclusions ); management.setExclusions( result ); + + final Object sourceHint = this.managedExclusionsSourceHints.get( key ); + if ( sourceHint != null ) + { + management.setExclusionsSourceHint( sourceHint.toString() ); + } } return management; @@ -261,8 +343,8 @@ else if ( null == obj || !getClass().equals( obj.getClass() ) ) ClassicDependencyManager that = (ClassicDependencyManager) obj; return depth == that.depth && managedVersions.equals( that.managedVersions ) - && managedScopes.equals( that.managedScopes ) && managedOptionals.equals( that.managedOptionals ) - && managedExclusions.equals( that.managedExclusions ); + && managedScopes.equals( that.managedScopes ) && managedOptionals.equals( that.managedOptionals ) + && managedExclusions.equals( that.managedExclusions ); } @Override @@ -311,9 +393,9 @@ else if ( !( obj instanceof Key ) ) } Key that = (Key) obj; return artifact.getArtifactId().equals( that.artifact.getArtifactId() ) - && artifact.getGroupId().equals( that.artifact.getGroupId() ) - && artifact.getExtension().equals( that.artifact.getExtension() ) - && artifact.getClassifier().equals( that.artifact.getClassifier() ); + && artifact.getGroupId().equals( that.artifact.getGroupId() ) + && artifact.getExtension().equals( that.artifact.getExtension() ) + && artifact.getClassifier().equals( that.artifact.getClassifier() ); } @Override diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java index f549367d7..dd5db312a 100644 --- a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java @@ -46,18 +46,39 @@ public final class DependencyManagerUtils */ public static final String NODE_DATA_PREMANAGED_VERSION = "premanaged.version"; + /** + * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the informational hint + * describing the source declaring the version management is stored. + * @since 1.2.0 + */ + public static final String NODE_DATA_VERSION_MANAGEMENT_SOURCE_HINT = "version.management.source.hint"; + /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the original scope is * stored. */ public static final String NODE_DATA_PREMANAGED_SCOPE = "premanaged.scope"; + /** + * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the informational hint + * describing the source declaring the scope management is stored. + * @since 1.2.0 + */ + public static final String NODE_DATA_SCOPE_MANAGEMENT_SOURCE_HINT = "scope.management.source.hint"; + /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the original optional * flag is stored. */ public static final String NODE_DATA_PREMANAGED_OPTIONAL = "premanaged.optional"; + /** + * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the informational hint + * describing the source declaring the optionality management is stored. + * @since 1.2.0 + */ + public static final String NODE_DATA_OPTIONALITY_MANAGEMENT_SOURCE_HINT = "optionality.management.source.hint"; + /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the original exclusions * are stored. @@ -66,6 +87,13 @@ public final class DependencyManagerUtils */ public static final String NODE_DATA_PREMANAGED_EXCLUSIONS = "premanaged.exclusions"; + /** + * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the informational hint + * describing the source declaring the exclusion management is stored. + * @since 1.2.0 + */ + public static final String NODE_DATA_EXCLUSIONS_MANAGEMENT_SOURCE_HINT = "exlusions.management.source.hint"; + /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the original properties * are stored. @@ -74,6 +102,13 @@ public final class DependencyManagerUtils */ public static final String NODE_DATA_PREMANAGED_PROPERTIES = "premanaged.properties"; + /** + * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the informational hint + * describing the source declaring the properties management is stored. + * @since 1.2.0 + */ + public static final String NODE_DATA_PROPERTIES_MANAGEMENT_SOURCE_HINT = "properties.management.source.hint"; + /** * Gets the version or version range of the specified dependency node before dependency management was applied (if * any). @@ -81,7 +116,7 @@ public final class DependencyManagerUtils * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The node's dependency version before dependency management or {@code null} if the version was not managed - * or if {@link #CONFIG_PROP_VERBOSE} was not enabled. + * or if {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static String getPremanagedVersion( DependencyNode node ) { @@ -92,13 +127,32 @@ public static String getPremanagedVersion( DependencyNode node ) return cast( node.getData().get( NODE_DATA_PREMANAGED_VERSION ), String.class ); } + /** + * Gets an informational hint describing the source declaring the version management of the specified dependency + * node after dependency management was applied (if any). + * + * @param node The dependency node to retrieve the data of, must not be {@code null}. + * + * @return The node's version management source hint or {@code null} if no such information is available or if + * {@link #CONFIG_PROP_VERBOSE} was not enabled. + * @since 1.2.0 + */ + public static String getVersionManagementSourceHint( DependencyNode node ) + { + if ( ( node.getManagedBits() & DependencyNode.MANAGED_VERSION ) == 0 ) + { + return null; + } + return cast( node.getData().get( NODE_DATA_VERSION_MANAGEMENT_SOURCE_HINT ), String.class ); + } + /** * Gets the scope of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The node's dependency scope before dependency management or {@code null} if the scope was not managed or - * if {@link #CONFIG_PROP_VERBOSE} was not enabled. + * if {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static String getPremanagedScope( DependencyNode node ) { @@ -109,13 +163,32 @@ public static String getPremanagedScope( DependencyNode node ) return cast( node.getData().get( NODE_DATA_PREMANAGED_SCOPE ), String.class ); } + /** + * Gets an informational hint describing the source declaring the scope management of the specified dependency + * node after dependency management was applied (if any). + * + * @param node The dependency node to retrieve the data of, must not be {@code null}. + * + * @return The node's scope management source hint or {@code null} if no such information is available or if + * {@link #CONFIG_PROP_VERBOSE} was not enabled. + * @since 1.2.0 + */ + public static String getScopeManagementSourceHint( DependencyNode node ) + { + if ( ( node.getManagedBits() & DependencyNode.MANAGED_SCOPE ) == 0 ) + { + return null; + } + return cast( node.getData().get( NODE_DATA_SCOPE_MANAGEMENT_SOURCE_HINT ), String.class ); + } + /** * Gets the optional flag of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The node's optional flag before dependency management or {@code null} if the flag was not managed or if - * {@link #CONFIG_PROP_VERBOSE} was not enabled. + * {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static Boolean getPremanagedOptional( DependencyNode node ) { @@ -126,13 +199,32 @@ public static Boolean getPremanagedOptional( DependencyNode node ) return cast( node.getData().get( NODE_DATA_PREMANAGED_OPTIONAL ), Boolean.class ); } + /** + * Gets an informational hint describing the source declaring the optionality management of the specified + * dependency node after dependency management was applied (if any). + * + * @param node The dependency node to retrieve the data of, must not be {@code null}. + * + * @return The node's optionality management source hint or {@code null} if no such information is available or if + * {@link #CONFIG_PROP_VERBOSE} was not enabled. + * @since 1.2.0 + */ + public static String getOptionalityManagementSourceHint( DependencyNode node ) + { + if ( ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) == 0 ) + { + return null; + } + return cast( node.getData().get( NODE_DATA_OPTIONALITY_MANAGEMENT_SOURCE_HINT ), String.class ); + } + /** * Gets the {@code Exclusion}s of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The nodes' {@code Exclusion}s before dependency management or {@code null} if exclusions were not managed - * or if {@link #CONFIG_PROP_VERBOSE} was not enabled. + * or if {@link #CONFIG_PROP_VERBOSE} was not enabled. * * @since 1.1.0 */ @@ -146,13 +238,32 @@ public static Collection getPremanagedExclusions( DependencyNode node return cast( node.getData().get( NODE_DATA_PREMANAGED_EXCLUSIONS ), Collection.class ); } + /** + * Gets an informational hint describing the source declaring the exclusions management of the specified dependency + * node after dependency management was applied (if any). + * + * @param node The dependency node to retrieve the data of, must not be {@code null}. + * + * @return The node's exclusions management source hint or {@code null} if no such information is available or if + * {@link #CONFIG_PROP_VERBOSE} was not enabled. + * @since 1.2.0 + */ + public static String getExclusionsManagementSourceHint( DependencyNode node ) + { + if ( ( node.getManagedBits() & DependencyNode.MANAGED_EXCLUSIONS ) == 0 ) + { + return null; + } + return cast( node.getData().get( NODE_DATA_EXCLUSIONS_MANAGEMENT_SOURCE_HINT ), String.class ); + } + /** * Gets the properties of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The nodes' properties before dependency management or {@code null} if properties were not managed or if - * {@link #CONFIG_PROP_VERBOSE} was not enabled. + * {@link #CONFIG_PROP_VERBOSE} was not enabled. * * @since 1.1.0 */ @@ -166,6 +277,25 @@ public static Map getPremanagedProperties( DependencyNode node ) return cast( node.getData().get( NODE_DATA_PREMANAGED_PROPERTIES ), Map.class ); } + /** + * Gets an informational hint describing the source declaring the properties management of the specified dependency + * node after dependency management was applied (if any). + * + * @param node The dependency node to retrieve the data of, must not be {@code null}. + * + * @return The node's properties management source hint or {@code null} if no such information is available or if + * {@link #CONFIG_PROP_VERBOSE} was not enabled. + * @since 1.2.0 + */ + public static String getPropertiesManagementSourceHint( DependencyNode node ) + { + if ( ( node.getManagedBits() & DependencyNode.MANAGED_EXCLUSIONS ) == 0 ) + { + return null; + } + return cast( node.getData().get( NODE_DATA_EXCLUSIONS_MANAGEMENT_SOURCE_HINT ), String.class ); + } + private static T cast( Object obj, Class type ) { return type.isInstance( obj ) ? type.cast( obj ) : null; diff --git a/pom.xml b/pom.xml index 3a6a692b9..8df1750ee 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ org.apache.maven.resolver maven-resolver - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT pom Maven Artifact Resolver