Q
分解EAR文件
2
A
回答
4
以編程方式或手動? EAR和WAR文件(如JAR文件)實際上只是具有已知內部文件/文件夾結構的ZIP文件。這意味着您可以像使用代碼或桌面應用程序一樣提取任何其他ZIP文件的EAR和WAR。
for Windows命令行工具將是巨大的。
- Java實現,你可以拖放到一個可執行的JAR很容易:https://stackoverflow.com/a/7108813/139010
- bash腳本:https://unix.stackexchange.com/a/4372/4515
- 最後,如果你不介意使用7zip的,與Windows兼容腳本:https://superuser.com/a/248349/9232
3
馬特的回答很有幫助,但有時很高興爲您寫出來。
這是我寫的一個shell腳本,用於解決我實際在Cygwin中運行的問題,但也可能在Linux中工作。它將解壓縮並打開戰爭,耳朵或罐子,並繼續解壓縮,直到遞歸直到沒有剩下。您可能想要在結果目錄中使用「diff -r ear1.ear-contents ear2.ear-contents」來比較兩個ear文件。
#!/bin/sh
rm -rf ${1}-contents
mkdir ${1}-contents
echo "Unpacking ${1} to ${1}-contents"
unzip -d ${1}-contents ${1}
cd ${1}-contents
FILES_TO_PROCESS=`find . -type f \(-name "*.ear" -or -name "*.war" -or -name "*.jar" \)`
until [ "$FILES_TO_PROCESS" == "" ] ; do
for myFile in $FILES_TO_PROCESS ; do
mkdir ${myFile}-contents
echo "Unpacking ${myFile} to ${myFile}-contents"
unzip -d ${myFile}-contents ${myFile}
rm $myFile
done
FILES_TO_PROCESS=`find . -type f \(-name "*.ear" -or -name "*.war" -or -name "*.jar" \)`
echo "recursing to process files: $FILES_TO_PROCESS"
done
相關問題
- 1. 與EAR文件
- 2. .war和.ear文件
- 3. EAR文件和ValidationMessages.properties
- 4. Netbeans使用JBoss5分解EAR開發
- 5. EAR文件位於何處?
- 6. 無法部署EAR文件
- 7. EAR文件中的問題
- 8. 帶有war文件的Gradle-ear文件
- 9. 在創建ear文件時將policy.xml複製到ear文件的meta-inf
- 10. 爆炸(未打包)EAR與打包的EAR文件?
- 11. EAR文件和「WebSphere Enhanced EAR」之間的區別是什麼?
- 12. 分解CSV文件
- 13. 從ear文件中存在的war文件中提取文件
- 14. jar文件位置 - ear文件或服務器lib文件夾?
- 15. JBOSS如何識別EAR文件
- 16. 部署ear文件時出現問題
- 17. 不能Weblogic上部署EAR文件12C
- 18. 在Jdeveloper中創建EAR文件
- 19. JDeveloper錯誤 - Ear文件構建
- 20. Websphere應用程序EAR屬性文件
- 21. 重用第二EAR文件使用JBoss
- 22. MyEclipse並製作一個EAR文件
- 23. 創建EAR的ZIP文件與Maven
- 24. 部署.ear文件到Glassfish 3.1.2
- 25. 如何使用JDeveloper創建.ear文件
- 26. maven deploy - 只上傳ear文件到nexus
- 27. 手術替換.ear中的類文件
- 28. 使用maven爲ADF生成ear文件...?
- 29. 根據戰爭文件構建Gradle ear
- 30. 在maven中準備Ear文件
如果它真的是你的項目,你應該有源?無論如何,您可以使用ZIP命令來提取EAR,WAR文件也是如此。 ***或***,您是否在問如何將EAR作爲展開式存檔部署到應用程序服務器? – Perception 2012-04-16 13:25:04
是的,這是我的來源。我想知道是否有一個自動化的工具來做到這一點,因爲耳朵裏有很多戰爭。我認爲將EAR部署爲展開式存檔的唯一方法是將耳朵中的內容複製到名爲「 .ear」的文件夾中,對嗎? –
Tony
2012-04-16 13:25:55