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 2022/02/03 07:09:46 UTC

[maven-site] 03/07: WIP

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch maven-repository-layout
in repository https://gitbox.apache.org/repos/asf/maven-site.git

commit 4ef74cc88697d4fa1316013767e189aa1d95023d
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Wed Jan 19 16:27:47 2022 +0100

    WIP
---
 content/markdown/repositories/index.md  | 41 +++++++++++++++++++++++++--------
 content/markdown/repositories/layout.md | 20 +++++++++-------
 content/markdown/repositories/local.md  |  2 +-
 3 files changed, 45 insertions(+), 18 deletions(-)

diff --git a/content/markdown/repositories/index.md b/content/markdown/repositories/index.md
index 1770a8f..3352c46 100644
--- a/content/markdown/repositories/index.md
+++ b/content/markdown/repositories/index.md
@@ -19,14 +19,37 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-Apache Maven uses repositories to store build artifacts. Your dependencies are being downloaded from repositories,
-and your built artifacts are being stored (installed, uploaded) into repositories as well. This is one of the 
-fundamental concept of Maven since its inception: Maven command line tool and Maven Repositories were mold together
-and developed since inception of Maven project itself.
+Apache Maven uses repositories to store artifacts. Your dependencies are being downloaded from repositories,
+and your artifacts are being stored (installed, uploaded) into repositories as well. This is one of the 
+fundamental concepts of Maven since its inception: Maven command line tool and Maven Repositories were mold together
+and developed since the beginning of Maven project itself.
 
-Maven addresses artifacts using coordinates, that are most often represented as `groupId`:`artifactId`:`version`, 
-or GAV in short (or informally). The artifact coordinates uniquely describes the artifact you are referring to, but
-does not tell anything about its source (or origin). It is up to Maven to figure out (or you to tell Maven how
-to figure it out).
+As you may know, Maven addresses artifacts using coordinates, that are most often represented as 
+`groupId:artifactId:version`, or GAV in short or when informally used (please note that Artifact coordinates has 
+more fields, but for brevity we still call the coordinates "GAV", not "GAVCE"). The artifact coordinate uniquely 
+describe the artifact you are referring to, but does not tell anything about its source (or origin). It is up to 
+Maven to figure out (or you to tell Maven how to figure it out).
+
+While Maven internally uses notion of "artifact" thoroughly (just look at sources!), end user may never hit this name.
+That's due the fact, that while for Maven, "everything is artifact" (internally), the end users actually speak about
+"projects", "parent projects", "dependencies", "plugins", "extensions" and so on.
+
+## Artifact properties
+
+The artifacts that Maven (internally) uses has following (among many others, but for our topic related) properties:
+
+| Name       | Description |
+|------------|-------------|
+| groupId    | The artifact group name |
+| artifactId | The artifact name |
+| version    | The artifact version |
+| classifier | The artifact distinguishing classifier |
+| extension  | The artifact extension |
+
+And some more, a bit of special ones:
+
+| Name | Description                                                                                                                                                                                                          |
+|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| type | The "type" of the artifact, implies extension.                                                                                                                                                                       |
+| baseVersion | Is actually derived from version (or other way around, depends on context): for release artifacts same as version, for snapshot artifacts this is always "non stamped snapshot version", for example "1.0-SNAPSHOT". |
 
-Maven in general operates with one local repository and one or more remote repositories.
\ No newline at end of file
diff --git a/content/markdown/repositories/layout.md b/content/markdown/repositories/layout.md
index 1a8dd1f..aace610 100644
--- a/content/markdown/repositories/layout.md
+++ b/content/markdown/repositories/layout.md
@@ -19,23 +19,27 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-The layout is responsible to translate the artifact coordinates into generic path, that is later used to construct some
-URI (file path, URL, it depends on context). Obviously, since Maven inception in 2002. the layout evolved as well.
+The layout is responsible to translate the artifact coordinates into generic paths, that is later used to construct some
+URI (file path, URL, it depends on context). Obviously, since Maven;s inception in 2002 the layout evolved as well.
 Due simplicity, we will cover current layout (aka "maven2" or "default"), as since Maven 3.x release, the deprecated
 "Maven1 layout" is not supported anymore.
 
+This above implies following: if the repository contains a file that is "not on layout" (does not obey layout 
+transformation rules discussed below), that file is "not addressable" by Maven coordinates, you cannot make Maven
+to download it using GAV coordinates!
+
 The original premise of layout was simplicity: from historical perspective, a remote repository was expected to be run
-by some compute with file storage (where artifacts were laid down) and served by a HTTP server, essentially publishing 
+by some computer with file storage (where artifacts were laid down) and served by a HTTP server, essentially publishing 
 the files on file paths for consumption (mainly for HTTP GET requests). Actually, the reason of layout change between
 Maven1 and Maven2 (the today's "default") was exactly that: Maven1 layout was stressing the underlying file system 
 way too much, it was not scaling in this setup.
 
 The transformation rule is quite simple for that matter:
 
-| Source coordinate | Trasformation | Result example |
-|-------------------|---------------|----------------|
-| Group ID          | Replace "." (dot) characters with "/" (dash) character | `org.apache.maven` -> `org/apache/maven` |
-| Artifact ID       | none          | `apache-maven` -> `apache-maven` |
-| Version           | none          | `3.8.4` -> `3.8.4` |
+| Source coordinate | Transformation                                          | Result example |
+|-------------------|---------------------------------------------------------|----------------|
+| Group ID          | Replace "." (dot) characters with "/" (slash) character | `org.apache.maven` -> `org/apache/maven` |
+| Artifact ID       | none                                                    | `apache-maven` -> `apache-maven` |
+| Version           | none                                                    | `3.8.4` -> `3.8.4` |
 
 
diff --git a/content/markdown/repositories/local.md b/content/markdown/repositories/local.md
index f58d06e..597238c 100644
--- a/content/markdown/repositories/local.md
+++ b/content/markdown/repositories/local.md
@@ -19,5 +19,5 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-The local repository is mixed bag, in sense, that it serves two purpose: it "caches" downloaded artifacts from
+The local repository is mixed bag, in sense, that it serves two purposes: it caches downloaded artifacts from
 remote repositories along with locally built and installed ones.