Customizing The File Name Mapping

@Parameter( defaultValue = "@groupId@-@artifactId@-@version@@dashClassifier?@.@extension@", required = true ) private String outputFileNameMapping;

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.0.2</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.0.2</version>
        <configuration>
           [...]
           <outputFileNameMapping>@{groupId}@-@{artifactId}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
        </configuration>
      </plugin>
    </plugins>
  </build>

Just a some words about the @dashClassifier?@ which expands to a classifier including the preceding dash which is needed to separate it from other parts of the artifact.