How to unpackage and repackage a WAR file

后端 未结 8 1068

I have a WAR file. I would like to open it, edit an XML file, remove some jars and then re-package it.

I used WINRAR to open the WAR file and I removed some Jars and

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 12:56

    you can update your war from the command line using java commands as mentioned here:

    jar -uvf test.war yourclassesdir 
    

    Other useful commands:

    Command to unzip/explode the war file

    jar -xvf test.war
    

    Command to create the war file

    jar -cvf test.war yourclassesdir 
    

    Eg:

    jar -cvf test.war *
    jar -cvf test.war WEB-INF META-INF
    

提交回复
热议问题