Reputation: 14399
According to the maven war plugin documentation I should be able to set the name of the generated war file with the parameter warName
. Is it not possible to do this from the command line with mvn -DwarName=mySpecificName package
? When I run maven like this the war file still gets the default name.
My webapp project is part of a multi module project and I only want to change the final name of the war file, not any other projects generated artifact.
I am using maven 3.0.4 and version 2.3 of the war plugin.
Upvotes: 5
Views: 3410
Reputation: 14399
After looking at the code of the war plugin I realize that it is not possible to set the warName
parameter from command line. I assumed that all parameters were possible to set from the command line. This assumption was incorrect.
Upvotes: 2
Reputation: 3202
You can achieve the same effect by maven property.
1) Define a property via
<properties>
<my.warName>xxx</my.warName>
</properties>
You can overwrite the default value by "-Dmy.warName=commandlineWarName"
2) Redefine the war name
<build>
<finalName>${my.warName}</finalName>
<!-- ... -->
</build>
Upvotes: 15