如何获取 WebSphere 8.5 服务器上已部署应用程序中特定模块的版本?
我尝试了以下命令。
获取所有已安装的应用程序:
wsadmin> $AdminApp list
MyApplicationEAR
获取此应用程序的版本 (MyApplicationEAR):
wsadmin> $AdminApp view MyApplicationEAR -buildVersion
Build-ID of application: SNAPSHOT_17-07-2014_16-33-28_rev_123
列出此应用程序的所有模块:
wsadmin> $AdminApp listModules MyApplicationEAR
MyApplicationEAR#MyApplicationWeb.war+WEB-INF/web.xml
MyApplicationEAR#Toolbox.war+WEB-INF/web.xml
获取一个模块的版本(MyApplicationWeb.war):
$AdminApp view MyApplicationEAR#MyApplicationWeb.war+WEB-INF/web.xml -buildVersion
WASX7015E: Exception while executing command: "$AdminApp view MyApplicationEAR#MyApplicationWeb.war+WEB-INF/web.xml -buildVersion". Exceptioninfo:
com.ibm.ws.scripting.ScriptingException: WASX7406E: The taskname buildVersion was not found in the application MyApplicationEAR.
但是如果我打开 WebSphere 管理控制台 GUI (localhost:xxxx/ibm/console) 并转到:
Applications >
Application Types >
WebSphere enterprise applications >
MyApplicationEAR >
MyApplicationEAR >
Display module build IDs
我可以看到所有模块的自己的版本。
EAR 的版本与META-INF/MANIFEST.MF中的每个模块的版本一样存储在Implementation-Version: XXX下。
有人提示,如何使用 wsadmin(或 Java AdminClient API)获取这些模块版本?