This is an automated email from the ASF dual-hosted git repository.
cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
The following commit(s) were added to refs/heads/master by this push:
new ff0f18fdb Enh: Maven 3 is with us (#1869)
ff0f18fdb is described below
commit ff0f18fdb10703f5bb26768316f0684b5dfe5730
Author: Tamas Cservenak <[email protected]>
AuthorDate: Mon May 11 23:09:50 2026 +0200
Enh: Maven 3 is with us (#1869)
Undeprecate things needed to use Resolver 2.x without ScopeManager.
These classes and methods were originally here, and should remain here to
make Resolver 2.x Maven-3 friendly, as Maven 3 unlike Maven 4, relies on these.
---
.../aether/artifact/ArtifactProperties.java | 24 +++++++++-------------
.../aether/artifact/DefaultArtifactType.java | 7 ++++---
.../eclipse/aether/util/artifact/JavaScopes.java | 4 +---
.../aether/util/filter/DependencyFilterUtils.java | 6 ++----
.../graph/manager/ClassicDependencyManager.java | 5 -----
.../graph/manager/DefaultDependencyManager.java | 5 -----
.../graph/manager/TransitiveDependencyManager.java | 5 -----
.../transformer/JavaDependencyContextRefiner.java | 4 ++--
.../util/graph/transformer/JavaScopeDeriver.java | 5 ++---
.../util/graph/transformer/JavaScopeSelector.java | 5 ++---
.../util/graph/traverser/FatArtifactTraverser.java | 2 --
11 files changed, 23 insertions(+), 49 deletions(-)
diff --git
a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java
b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java
index 595288f9d..e61e8fef5 100644
---
a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java
+++
b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java
@@ -21,7 +21,7 @@ package org.eclipse.aether.artifact;
import org.eclipse.aether.RepositorySystemSession;
/**
- * The keys for common properties of artifacts.
+ * The keys for common properties of artifacts in Maven 3.
*
* @see Artifact#getProperties()
*/
@@ -44,24 +44,21 @@ public final class ArtifactProperties {
* to be not present in any regular repository and likewise has no
artifact descriptor. Artifact resolution will
* verify the path and resolve the artifact if the path actually denotes
an existing file. If the path isn't valid,
* resolution will fail and no attempts to search local/remote
repositories are made.
- *
- * @deprecated since 2.0, the semantic carried by this property and the
fact this property is coupled to Resolver
+ * <p>
+ * Since 2.0, the semantic carried by this property and the fact this
property is coupled to Resolver
* 1.x "system" scope (that was delegated to consumer application) implies
this property should not be used anymore,
* instead, the {@link org.eclipse.aether.scope.ScopeManager} exposed via
method
- * {@link RepositorySystemSession#getScopeManager()} should be used.
+ * {@link RepositorySystemSession#getScopeManager()} can be used.
*/
- @Deprecated
public static final String LOCAL_PATH = "localPath";
/**
* A boolean flag indicating whether the artifact presents some kind of
bundle that physically includes its
* dependencies, e.g. a fat WAR.
- *
- * @deprecated since 2.0, the semantic carried by this property should be
defined in a custom
- * {@link org.eclipse.aether.collection.DependencyTraverser}
implementation provided by the resolver
- * consumer
+ * <p>
+ * Since 2.0, the semantic carried by this property could be defined in a
custom
+ * {@link org.eclipse.aether.collection.DependencyTraverser}
implementation provided by the resolver consumer.
*/
- @Deprecated
public static final String INCLUDES_DEPENDENCIES = "includesDependencies";
/**
@@ -71,11 +68,10 @@ public final class ArtifactProperties {
* Note: This property is about "build path", whatever it means in the
scope of the consumer project. It is NOT
* about Java classpath or anything alike. How artifact is being consumed
depends heavily on the consumer project.
* Resolver is and will remain agnostic of consumer project use cases.
- *
- * @deprecated since 2.0, this property should be defined by the resolver
consumer along with the {@link ArtifactType}
- * implementation
+ * <p>
+ * Since 2.0, this property could be defined by the resolver consumer
along with the {@link ArtifactType}
+ * implementation
*/
- @Deprecated
public static final String CONSTITUTES_BUILD_PATH = "constitutesBuildPath";
/**
diff --git
a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java
b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java
index 473f75fe2..5249054b6 100644
---
a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java
+++
b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java
@@ -26,10 +26,7 @@ import static java.util.Objects.requireNonNull;
/**
* A simple artifact type.
- *
- * @deprecated since 2.0, the artifact types should be defined by the resolver
consumer
*/
-@Deprecated
public final class DefaultArtifactType implements ArtifactType {
private final String id;
@@ -123,18 +120,22 @@ public final class DefaultArtifactType implements
ArtifactType {
return (str == null) ? "" : str;
}
+ @Override
public String getId() {
return id;
}
+ @Override
public String getExtension() {
return extension;
}
+ @Override
public String getClassifier() {
return classifier;
}
+ @Override
public Map<String, String> getProperties() {
return properties;
}
diff --git
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java
index 6cb6aed51..c7e65c3f0 100644
---
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java
+++
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java
@@ -19,12 +19,10 @@
package org.eclipse.aether.util.artifact;
/**
- * The dependency scopes used for Java dependencies.
+ * The Maven 3 dependency scopes used for Java dependencies.
*
* @see org.eclipse.aether.graph.Dependency#getScope()
- * @deprecated definition and semantics of the scopes should be defined by
consumer project
*/
-@Deprecated
public final class JavaScopes {
public static final String COMPILE = "compile";
diff --git
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java
index 433b6202a..6369a8a8d 100644
---
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java
+++
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java
@@ -112,12 +112,11 @@ public final class DependencyFilterUtils {
* @param classpathTypes the classpath types, may be {@code null} or empty
to match no dependency
* @return the new filter, never {@code null}
* @see JavaScopes
- * @deprecated resolver is oblivious about "scopes", it is consumer
project which needs to lay these down and
+ * Maven 3: resolver should be oblivious about "scopes", it is consumer
project which needs to lay these down and
* also assign proper semantics. Moreover, Resolver is oblivious about
notions of "classpath", "modulepath", and
* any other similar uses. These should be handled by consumer project.
* @see
org.eclipse.aether.scope.ScopeManager#getDependencyFilter(org.eclipse.aether.RepositorySystemSession,
org.eclipse.aether.scope.ResolutionScope)
*/
- @Deprecated
public static DependencyFilter classpathFilter(String... classpathTypes) {
return classpathFilter((classpathTypes != null) ?
Arrays.asList(classpathTypes) : null);
}
@@ -129,11 +128,10 @@ public final class DependencyFilterUtils {
* @param classpathTypes the classpath types, may be {@code null} or empty
to match no dependency
* @return the new filter, never {@code null}
* @see JavaScopes
- * @deprecated resolver is oblivious about "scopes", it is consumer
project which needs to lay these down and
+ * Maven 3: resolver should be oblivious about "scopes", it is consumer
project which needs to lay these down and
* also assign proper semantics. Moreover, Resolver is oblivious about
notions of "classpath", "modulepath", and
* any other similar uses. These should be handled by consumer project.
*/
- @Deprecated
public static DependencyFilter classpathFilter(Collection<String>
classpathTypes) {
Collection<String> types = new HashSet<>();
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 04e25d447..beefb1cb6 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
@@ -64,12 +64,7 @@ import org.eclipse.aether.scope.SystemDependencyScope;
public final class ClassicDependencyManager extends AbstractDependencyManager {
/**
* Creates a new dependency manager without any management information.
- *
- * @deprecated Use {@link #ClassicDependencyManager(ScopeManager)} instead
to provide
- * application-specific scope management. This constructor
uses legacy system
- * dependency scope handling which may not be appropriate for
all use cases.
*/
- @Deprecated
public ClassicDependencyManager() {
this(null);
}
diff --git
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DefaultDependencyManager.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DefaultDependencyManager.java
index 161311884..05fc72f9b 100644
---
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DefaultDependencyManager.java
+++
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DefaultDependencyManager.java
@@ -72,12 +72,7 @@ import org.eclipse.aether.scope.SystemDependencyScope;
public final class DefaultDependencyManager extends AbstractDependencyManager {
/**
* Creates a new dependency manager without any management information.
- *
- * @deprecated Use {@link #DefaultDependencyManager(ScopeManager)} instead
to provide
- * application-specific scope management. This constructor
uses legacy system
- * dependency scope handling.
*/
- @Deprecated
public DefaultDependencyManager() {
this(null);
}
diff --git
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/TransitiveDependencyManager.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/TransitiveDependencyManager.java
index b46211be0..c45b64bc7 100644
---
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/TransitiveDependencyManager.java
+++
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/TransitiveDependencyManager.java
@@ -72,12 +72,7 @@ import org.eclipse.aether.scope.SystemDependencyScope;
public final class TransitiveDependencyManager extends
AbstractDependencyManager {
/**
* Creates a new dependency manager without any management information.
- *
- * @deprecated Use {@link #TransitiveDependencyManager(ScopeManager)}
instead to provide
- * application-specific scope management. This constructor
uses legacy system
- * dependency scope handling.
*/
- @Deprecated
public TransitiveDependencyManager() {
this(null);
}
diff --git
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java
index 82763e797..a8231469d 100644
---
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java
+++
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java
@@ -31,11 +31,11 @@ import static java.util.Objects.requireNonNull;
* A dependency graph transformer that refines the request context for nodes
that belong to the "project" context by
* appending the buildpath type to which the node belongs. For instance, a
compile-time project dependency will be
* assigned the request context "project/compile".
+ * <p>
+ * To be used with Maven 3 (without scope manager).
*
* @see DependencyNode#getRequestContext()
- * @deprecated this class belongs to consumer project. Resolver should have no
notion of scopes.
*/
-@Deprecated
public final class JavaDependencyContextRefiner implements
DependencyGraphTransformer {
@Override
diff --git
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java
index 46e4d9553..025989d2c 100644
---
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java
+++
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java
@@ -25,10 +25,9 @@ import
org.eclipse.aether.util.graph.transformer.ConflictResolver.ScopeDeriver;
/**
* A scope deriver for use with {@link ConflictResolver} that supports the
scopes from {@link JavaScopes}.
- *
- * @deprecated this class belongs to consumer project. Resolver should have no
notion of scopes.
+ * <p>
+ * To be used with Maven 3 (without scope manager).
*/
-@Deprecated
public final class JavaScopeDeriver extends ScopeDeriver {
/**
diff --git
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java
index 443b8dec5..b8992c0c3 100644
---
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java
+++
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java
@@ -32,10 +32,9 @@ import
org.eclipse.aether.util.graph.transformer.ConflictResolver.ScopeSelector;
* A scope selector for use with {@link ConflictResolver} that supports the
scopes from {@link JavaScopes}. In general,
* this selector picks the widest scope present among conflicting dependencies
where e.g. "compile" is wider than
* "runtime" which is wider than "test". If however a direct dependency is
involved, its scope is selected.
- *
- * @deprecated this class belongs to consumer project. Resolver should have no
notion of scopes.
+ * <p>
+ * To be used with Maven 3 (without scope manager).
*/
-@Deprecated
public final class JavaScopeSelector extends ScopeSelector {
/**
diff --git
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java
index 0ddc0add3..72cc94a7e 100644
---
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java
+++
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java
@@ -31,9 +31,7 @@ import static java.util.Objects.requireNonNull;
* {@code true}.
*
* @see org.eclipse.aether.artifact.Artifact#getProperties()
- * @deprecated since 2.0, the DependencyTraverser implementation should be
provided by the resolver consumer
*/
-@Deprecated
public final class FatArtifactTraverser implements DependencyTraverser {
/**