Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change name of generated war file and duplicate war file

Tags:

gradle

i want to set the filename of the war task output before it is deployed to repository. e.g. project name is abc and originally it would result in abc-1.0.0-SNAPSHOT.war

But i want that there should be two generated war files with the same content:

  • def-1.0.0-SNAPSHOT.war
  • ghi-1.0.0-SNAPSHOT.war
like image 987
Cengiz Avatar asked Feb 08 '13 08:02

Cengiz


3 Answers

In build.gradle you can set the archive name:

war.archiveName "YOUR_SPECIAL_NAME.war"

gradle reference

like image 69
eldad levy Avatar answered Nov 05 '22 21:11

eldad levy


Another one, for example:

war {
    baseName = 'service'
    version = '0.0.1-SNAPSHOT-' + System.currentTimeMillis();
}
like image 35
Vladimir Rozhkov Avatar answered Nov 05 '22 21:11

Vladimir Rozhkov


task doPack(type: War, dependsOn: []) {
    archiveName "ROOT.war"

That worked for me

like image 6
russellsimokins Avatar answered Nov 05 '22 20:11

russellsimokins