如何在MS Windows中使用命令行将TXT文件添加到WAR文件 [英] How to add TXT file to the WAR archive using command-line in MS Windows

查看:241
本文介绍了如何在MS Windows中使用命令行将TXT文件添加到WAR文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有key.txt文件在E:/ drive和app.war文件在C:/驱动器。
如何将key.txt复制到app.war文件的子文件夹,即WebContent / WEB-INF。
键应该复制到WEB-INF文件夹。我想要结果像(解压缩war文件后)

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


推荐答案

您可以使用 jar 命令解压并重新创建您的WAR文件:

You can use the jar command to extract and re-create your WAR file:

mkdir mywar
cd mywar
jar -xf c:\path\to\mywar.war
copy c:\path\to\key.txt WEB-INF\
jar -cf c:\path\to\mynewwar.war .

这篇关于如何在MS Windows中使用命令行将TXT文件添加到WAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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