[
https://issues.apache.org/jira/browse/MNG-8026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17810829#comment-17810829
]
ASF GitHub Bot commented on MNG-8026:
-------------------------------------
gnodet commented on code in PR #1391:
URL: https://github.com/apache/maven/pull/1391#discussion_r1466200346
##########
api/maven-api-core/src/main/java/org/apache/maven/api/Artifact.java:
##########
@@ -105,6 +105,14 @@ default String key() {
*/
boolean isSnapshot();
+ /**
+ * The artifact properties.
+ *
+ * @return the artifact properties, never {@code null}
+ */
+ @Nonnull
+ ArtifactProperties getArtifactProperties();
Review Comment:
> No, `Type` is a property of `Dependency`, no Artifact. What happens is
that is just an indirection of `Type` -> `properties`. If you think about,
EVERY Artifact (sans root) have type (as they enter scope as dependencies of
root).
That's wrong. Artifacts can be resolved without any Type / Dependency at all
using the `ArtifactResolver`:
https://github.com/apache/maven/blob/2788849c37ed4c425eb9532c5e20b17f85cbe396/api/maven-api-core/src/main/java/org/apache/maven/api/services/ArtifactResolver.java
That's the whole point. ArtifactCoordinate is used to obtain an Artifact.
A DependencyCoordinate is used to obtain a Dependency. `DependencyCoordinate`
contains `Type` and `Scope`.
If we need some properties on `Artifact`, that's fine, we can define
`ArtifactProperties` and `DependencyProperties` which extends
`ArtifactProperties`. The artifact properties should contain only properties
that are related to an artifact, not its usage (type, scope, etc...). But my
understanding is that there's no properties at the moment. The only one in the
resolver is the path of the file, which is obtained from the `ArtifactManager`.
> And yes, am looking at Resolver API as it is done well and works. IMO we
should really just pull a thin layer on top of it for start, that we can refine
later. But in general, this is how things should work, really.
> Maven should define from ground up scopes used with Resolver
> ------------------------------------------------------------
>
> Key: MNG-8026
> URL: https://issues.apache.org/jira/browse/MNG-8026
> Project: Maven
> Issue Type: Task
> Reporter: Tamas Cservenak
> Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-13
>
>
> See MRESOLVER-471, it is actually role of Maven (as a resolver consumer
> project) to define all these things:
> * supported scopes
> * transformations of scopes to build path scopes
> * fine tune conflict resolution and related things (in session)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)