I'm trying to rename the default output classifer of a jar filename that is part of a WAR project.
By default it generates the following output jar ${project.artifactId}-{project.version}-classifier (in my example it would result in mywebapp-0.0.1-SNAPSHOT-client).
I would like to create instead the following output jar: ${project.artifactId}-classifier-${project.version} (in my example mywebapp-client-0.0.1-SNAPSHOT).
How is it possible ?
...
<artifactId>mywebapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
...
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-client-${project.version}</finalName>
<classifier>client</classifier>
<includes>
<include>client/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
...
You almost did everything correctly , just remove the classifier tag from inside the configuration and then try.
<configuration>
<finalName>${project.artifactId}-client-${project.version}</finalName>
<includes>
<include>client/*</include>
</includes>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With