Is there a way to check before adding module to JBoss using CLI?

℡╲_俬逩灬. 提交于 2019-12-04 05:56:15

When in domain mode, you can do that.

Here's how you can check a module's existence:

if (outcome != success) of /host=master/core-service=module-loading/:list-resource-loader-paths(module=your.module.name)
    echo install your.module.name ...   
    module add --name=your.module.name --dependencies=.. --resources=....jar
else 
    echo module your.module.name already installed
end-if

There are only two options "add" and "remove". They fail when they are set in an "if" statement, so as far as I know the existence of the module cannot be checked. If the module does exist and "add" is executed it fails, the same happens if we try to remove a non-existing module. So finally I have created two scripts, one to add the modules and another one to delete them. You can check the "module" command documentation here: cli command to add/remove AS modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!