如何在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的版本与实施 - 版本:XXX 下的 META-INF / MANIFEST.MF 中的每个模块的版本一样存储。
有人提示,如何使用wsadmin(或使用Java AdminClient API)获取这些模块版本?
答案 0 :(得分:2)
如果您只是为模块运行view命令,例如$AdminApp view MyAppTestEAR#MyAppTest.war+WEB-INF/web.xml
,则在输出结尾处会找到Build ID: 1.1
wsadmin>$AdminApp view MyAppTestEAR#MyAppTest.war+WEB-INF/web.xml
MapModulesToServers: Selecting servers
Specify targets such as application servers or clusters of application servers
here you want to install the modules that are contained in your application. Mo
ules can be installed on the same application server or dispersed among several
application servers.
Also, specify the Web servers as targets that serve as routers for requests to
his application.
The plug-in configuration file (plugin-cfg.xml) for each Web server is generate
, based on the applications that are routed through.
Module: MyAppTest
URI: MyAppTest.war,WEB-INF/web.xml
Server: WebSphere:cell=rad9vmNode02Cell,node=rad9vmNode02,server=server1
.... // cut off irrelevant output for short
ModuleBuildID: Module Build ID
Display module build IDs.
Module: MyAppTest
URI: MyAppTest.war,WEB-INF/web.xml
Build ID: 1.1
wsadmin>
<强>更新强>
您实际上可以在您的应用程序上运行它,您不必指定模块:
wsadmin>$AdminApp view MyAppTestEAR -ModuleBuildID
ModuleBuildID: Module Build ID
Display module build IDs.
Module: MyAppTest
URI: MyAppTest.war,WEB-INF/web.xml
Build ID: 1.1
要获得可用选项,您可以运行-tasknames
wsadmin>$AdminApp view MyAppTestEAR -tasknames
CustomActivationPlan
MetadataCompleteForModules
JSPReloadForWebMod
MapWebModToVH
SharedLibRelationship
AppDeploymentOptions
MapJaspiProvider
MapModulesToServers
MapResEnvRefToRes
ModuleBuildID
MapSharedLibForMod
CtxRootForWebMod