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

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-war-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 28dace2  Document the default file name mapping and the supported 
tokens
28dace2 is described below

commit 28dace272b205c9c1a496ab221b2a53b7ea80c85
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Mon Oct 26 15:07:07 2026 +0100

    Document the default file name mapping and the supported tokens
---
 src/site/markdown/examples/file-name-mapping.md | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/site/markdown/examples/file-name-mapping.md 
b/src/site/markdown/examples/file-name-mapping.md
index f0d3ac1..95ca061 100644
--- a/src/site/markdown/examples/file-name-mapping.md
+++ b/src/site/markdown/examples/file-name-mapping.md
@@ -30,16 +30,25 @@ under the License.
 It might be necessary to customize the file name of libraries and TLDs. By 
default, those resources are stored using the following pattern:
 
 ```unknown
-@{artifactId}@-@{version}@.@{extension}@
+@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@
 ```
 
-If the artifact has a classifier the default pattern is of course:
+For example, `commons-lang3-3.17.0.jar`, `commons-lang3-3.17.0-tests.jar` for 
an artifact with the `tests` classifier, or `my-lib-1.0-SNAPSHOT.jar` for a 
`SNAPSHOT` dependency, whatever timestamp it was resolved with.
 
-```unknown
-@{artifactId}@-@{version}@-@{classifier}@.@{extension}@
-```
+The `outputFileNameMapping` parameter allows you to give a custom pattern. 
Each token defined in the pattern will be replaced with a value from the 
current artifact. The following tokens are supported:
+
+- `@{groupId}@` - the artifact's group ID
+- `@{artifactId}@` - the artifact's ID
+- `@{version}@` - the artifact version; for `SNAPSHOT` artifacts this can 
contain a timestamp instead of `SNAPSHOT`
+- `@{baseVersion}@` - the base artifact version; for `SNAPSHOT` artifacts this 
always ends with `SNAPSHOT`
+- `@{classifier}@` - the artifact's classifier, or nothing if it has none
+- `@{extension}@` - the artifact's file extension
+- `@{dashClassifier}@` - the classifier preceded by a dash, or nothing if the 
artifact has no classifier or a blank one
+- `@{dashClassifier?}@` - same as `@{dashClassifier}@`; the spelling supported 
since 2.1
+
+On this Maven 3 line, other properties of Artifact and ArtifactHandler (for 
example `type` or `scope`) also resolve as tokens. The Maven 4 API has no such 
properties, so a pattern that should work on both lines uses only the tokens 
listed above.
 
-The `outputFileNameMapping` parameter allows you to give a custom pattern. 
Each token defined in the pattern will be replaced with a value from the 
current artifact. You can use any property of Artifact and ArtifactHandler as a 
token. There is also a special token named `dashClassifier?` that can be used, 
since 2.1. It will add the string "-yourclassifier" if and only if the artifact 
has a classifier.
+If two artifacts end up with the same file name, both are stored with their 
group ID as a prefix, for example `org.sample-my-lib-1.0.jar`.
 
 For instance, to store the libraries and TLDs without version numbers or 
classifiers, use the following pattern:
 

Reply via email to