You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/09/09 11:53:16 UTC

[GitHub] [maven-site] gnodet commented on a diff in pull request #287: Maven Repositories documentation

gnodet commented on code in PR #287:
URL: https://github.com/apache/maven-site/pull/287#discussion_r966987214


##########
content/markdown/repositories/artifacts.md:
##########
@@ -0,0 +1,122 @@
+# Maven Artifacts
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+Artifact is "anything" that Maven downloads, installs or deploys for you. Most of them are POMs and JARs but 
+the artifact can be really anything. A very important thing about artifacts is that they have coordinates,
+so they are not "just files", but they are files that are in some way addressable by Maven.
+
+Artifact coordinates, 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), Maven end users actually speak about
+"projects", "parent projects", "dependencies", "build plugins", "build extensions" and so on.
+
+## Artifact properties
+
+The artifacts that Maven (internally) uses has following (for our topic related) properties:
+
+| Name       | Description                                       |
+|------------|---------------------------------------------------|
+| groupId    | The artifact group                                |
+| artifactId | The artifact name                                 |
+| version    | The artifact version                              |
+| classifier | The artifact distinguishing classifier (optional) |
+| extension  | The artifact extension                            |
+
+Some more properties worth mention, is a bit of special one: `baseVersion` that is actually derived from version 
+(or other way around, depends on context): for release artifacts holds same value as `version`, for snapshot artifacts 
+holds "non-timestamped snapshot version". For example, for snapshot `version` "1.0-20220119.164608-1" value of the 
+`baseVersion` would have value "1.0-SNAPSHOT". So, `version` and `baseVersion` are linked, derived from each other, 
+but they have different values only in case of snapshots.

Review Comment:
   One additional property worth mentioning is a bit of special one: `baseVersion` that is actually derived from version (or the other way around, depending on the context): for release artifacts, it holds the same value as `version` whereas for snapshot artifacts, it holds the  "non-timestamped snapshot version". For example, for snapshot `version` "1.0-20220119.164608-1", the `baseVersion` would have the value "1.0-SNAPSHOT". So, `version` and `baseVersion` are linked, derived from each other,  but they have different values only in case of snapshots.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org