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/01/20 07:20:19 UTC

[maven-site] branch master updated: section about extensions and classifiers

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-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 22f23df  section about extensions and classifiers
22f23df is described below

commit 22f23df1049da80b794eab430d415c56dfd97f54
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Thu Jan 20 08:20:17 2022 +0100

    section about extensions and classifiers
---
 content/markdown/repository/layout.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/content/markdown/repository/layout.md b/content/markdown/repository/layout.md
index 66de410..b57d52c 100644
--- a/content/markdown/repository/layout.md
+++ b/content/markdown/repository/layout.md
@@ -66,3 +66,14 @@ For artifact files, there are 2 options available:
 
 Repository can be accessed through many file-oriented protocols, both for read and write: most classical are `file://`, `http://` and `https://` (`GET` and `PUT`).
 Older (now unused) protocols are FTP(S), SCP, SSH, ...
+Older (now generally unused) protocols are FTP(S), SCP, SSH, ...
+
+## Extensions and Classifiers
+
+Obviously, `${groupId}`, `${artifactId}` and `${version}` are defined in `pom.xml`. But what about `${classifier}` and `${extension}`, how are they defined?
+
+At artifact publication time, extensions and classifiers are defined by plugins that create the artifacts and attach them for publication.
+Some plugins provide configuration parameters to be able to override some default values. For example, [Maven JAR Plugin's `jar:jar` goal](/plugins/maven-jar-plugin/jar-mojo.html)
+by default produces an artifact with empty classifier and `jar` extension, and the `classifier` goal parameter can be used to define another classifier (no parameter to override extension).
+
+At artifact usage, usage happens through dependencies definition. Defining [`<dependency>`'s `<type>`](/ref/current/maven-model/maven.html#class_dependency) is what defines the initial extensions and classifier (by default, Maven considers a dependency type to be `jar`): see [default artifact handlers](/ref/current/maven-core/artifact-handlers.html) to see what default types exist and how they are bound to extensions and classifiers values. After that, you can also define `<dependency>`' [...]