Customizing The File Name Mapping
It might happen that you need to change the naming of the artifacts within the EAR file. This can be achieved by using the outputFileNameMapping
. The following shows how it could be configured in your pom file.
In this example the default value is given as a starting point.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>3.4.0</version>
<configuration>
[...]
<outputFileNameMapping>@{groupId}@-@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
</configuration>
</plugin>
</plugins>
</build>
Based on the given things you can influence the resulting naming based on your wishes. For example you want to have all artifacts within your ear file without a version you can change the configuration like the following:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>3.4.0</version>
<configuration>
[...]
<outputFileNameMapping>@{groupId}@-@{artifactId}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
</configuration>
</plugin>
</plugins>
</build>
@{dashClassifier?}@
- expands to a classifier including the preceding dash which is needed to separate it from other parts of the artifact@{version}@
- expands to artifact version, forSNAPSHOT
artifacts can contain timestamp postfix instead ofSNAPSHOT
@{baseVersion}@
- expands to base artifact version, forSNAPSHOT
artifacts we will always haveSNAPSHOT
postfix