如何解压缩和重新打包WAR文件 [英] How to unpackage and repackage a WAR file

查看:1033
本文介绍了如何解压缩和重新打包WAR文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WAR文件。我想打开它,编辑一个XML文件,删除一些罐子,然后重新打包。



我使用WINRAR打开WAR文件,我删除了一些罐子并在WinRar中创建了一个添加到存档并创建了一个WAR。



当我在jboss文件夹中部署WAR时,我得到了一个例外。

  16:05:14,316 ERROR [org.jboss.msc.service.fail](MSC服务主题1-2)
MSC00001:失败启动服务jboss.deployment.unit。myapplication.war。
结构:
服务中的org.jboss.msc.service.StartException jboss.deployment.unit。myapplication.war.STRUCTURE:
无法处理部署myapplication.war的阶段结构

我如何重新包装WAR?

  jar -uvf test.war yourclassesdir 

其他有用的命令:



解压缩/爆炸war文件的命令

  jar -xvf test.war 

创建war文件的命令

  jar -cvf test.war yourclassesdir 


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 did an 'Add to Archive' in WinRar and created a WAR.

When I deployed the WAR in jboss folder, I got an exception.

   16:05:14,316 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) 
   MSC00001: Failed to start service jboss.deployment.unit."myapplication.war".
   STRUCTURE: org.jboss.msc.service.StartException in 
   service   jboss.deployment.unit."myapplication.war".STRUCTURE: 
   Failed to process phase STRUCTURE of deployment "myapplication.war"

How do I repackage the WAR ?

解决方案

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 

这篇关于如何解压缩和重新打包WAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆