How to add TXT file to the WAR archive using command-line in MS Windows

10,778

Finally i got answer, for this i used.

mkdir c:/WEB-INF
cd WEB-INF
xcopy D:/key.txt C:/WEB-INF
jar uvf app.war /WEB-INF/key.txt

No need of unzipping and again zipping.

Share:
10,778
Tamanna Iruu
Author by

Tamanna Iruu

Updated on June 04, 2022

Comments

  • Tamanna Iruu
    Tamanna Iruu almost 2 years

    I have key.txt file in E:/ drive and app.war file in C:/ drive. How to copy key.txt to the subfolder of the app.war file i.e WebContent/WEB-INF. Key should copy to the WEB-INF folder. I want result like(after unzipping war file)

    WebContent
    |
    |->META-INF
    |->WEB-INF
            |
            |->key.txt
    
  • Tamanna Iruu
    Tamanna Iruu about 10 years
    James cp command is not working I try with cp and also xcopy.
  • earldouglas
    earldouglas about 10 years
    How about copy? I'll grab a Windows box in a little while and correct my answer.
  • earldouglas
    earldouglas about 10 years
    I updated the commands above to work in a Windows environment.