You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2020/04/28 11:15:39 UTC
[maven-artifact-transfer] branch master updated: added a note about
Maven Artifact API
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-artifact-transfer.git
The following commit(s) were added to refs/heads/master by this push:
new c94eb64 added a note about Maven Artifact API
c94eb64 is described below
commit c94eb64eb857d6880f3975ff118d0d0fb2188860
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Tue Apr 28 13:15:29 2020 +0200
added a note about Maven Artifact API
---
src/site/apt/comparison.apt | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/site/apt/comparison.apt b/src/site/apt/comparison.apt
index d808afa..3b9c371 100644
--- a/src/site/apt/comparison.apt
+++ b/src/site/apt/comparison.apt
@@ -31,11 +31,11 @@ Comparison: Dependency vs Artifact vs MavenProject
Here's a small matrix which should help you choosing the right instance.
In general:
-
+
* an Artifact holds a file mapped on a certain coordinate (GAV + classifier + extension),
-
+
* a {{{/ref/current/maven-model/maven.html#class_dependency}Dependency}} contains an artifact and has transitive information,
-
+
* a MavenProject holds a pom-file, an optional main file derived from the packaging, and can have attached files (= with classifier and extension), all using the same GAV.
[]
@@ -54,10 +54,13 @@ Comparison: Dependency vs Artifact vs MavenProject
| attached artifacts | no | no | yes |
*--------------------+-------------+----------------+---------------+
-This implies the following:
+ This implies the following:
+
+ * From dependency to artifact is possible, since you can map a type to an extension (see {{{/ref/current/maven-core/artifact-handlers.html}default dependency types}}).
+ However, it is not possible to go from artifact back to dependency, there are several types which have jar as file extension for example.
- * From dependency to artifact is possible, since you can map a type to an extension.
- However, it is not possible to go from artifact back to dependency, there are several types which have jar as file extension.
-
* There's no such thing as transitive artifacts. Filtering during resolution is based on DependencyFilters,
- ArtifactFilters can only be applied afterwards, hence are less efficient.
+ ArtifactFilters can only be applied afterwards, hence are less powerful.
+
+ Notice that for historical reasons, Maven internal {{{/ref/current/maven-artifact/apidocs/org/apache/maven/artifact/Artifact.html}Artifact API}}
+ mixes dependency and artifact concepts.