小编tes*_*ezz的帖子

如何从war文件中只提取一个文件?

我正在 Linux 中为 Ansible 创建 shell 命令,我有一个 .war文件,我只需要其中的tasks.properties文件。我尝试了下面的方法,但它提取了父目录文件夹WEB-INF,因此,当我只需要外面的test.properties时,我提取了WEB-INF/sub/test.properties

unzip test.war "*test.properties*" 
Run Code Online (Sandbox Code Playgroud)

我也尝试过

jar xf test.war test.properties
Run Code Online (Sandbox Code Playgroud)

这还提取了主文件夹和WEB-INF/sub/test.properties

当我时ls,我只想test.properties出现在我运行它的位置,关于如何做到这一点有什么建议吗?

linux yaml unzip ansible

2
推荐指数
1
解决办法
979
查看次数

标签 统计

ansible ×1

linux ×1

unzip ×1

yaml ×1