简体   繁体   English

如何更新 .ear 文件中的 .jar 文件并使用 bash 脚本保存 .ear 文件

[英]How to update a .jar file inside .ear file and save the .ear file using bash script

How to update a .jar file inside .ear file and save the .ear file using bash script?如何更新 .ear 文件中的 .jar 文件并使用 bash 脚本保存 .ear 文件?

The flow works like below:流程如下:

I have an older.ear (located at Documents/older.ear)
that contains older.ear/APP-INF/libs/updateme.jar &
I have a updateme.jar file (located at Documents/libs/updateme.jar), 
which needs to be updated to older.ear/APP-INF/libs/updateme.jar, 
then the ear file has to be saved.

As of now, I am been using 7zip , but would like to have it automated with a bash script.截至目前,我一直在使用7zip ,但希望使用 bash 脚本使其自动化。

An EAR file is simply a zip file, so you should: EAR文件只是一个 zip 文件,因此您应该:

  1. Unzip the EAR file by 7z .通过7z解压缩 EAR 文件。
  2. Replace the JAR file.替换 JAR 文件。
  3. Recreate the EAR file by 7z .通过7z重新创建 EAR 文件。

The instructions to accomplish this are trivial, you can write them on your own.完成此操作的说明很简单,您可以自己编写。

Regards.问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM