有没有办法在使用 CLI 将模块添加到 JBoss 之前进行检查? [英] Is there a way to check before adding module to JBoss using CLI?
本文介绍了有没有办法在使用 CLI 将模块添加到 JBoss 之前进行检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在使用 JBoss CLI 调用添加之前,有没有办法检查模块尚未添加?
Is there a way to check module hasn't already been added before calling adding using JBoss CLI?
例如
module add --name=org.mysql --resources=/home/abc/drivers/mysql/MySQL5.jar
# Want to do similar check for module add
if (outcome != success) of /subsystem=datasources/jdbc-driver=org.mysql:read-resource
# Add it...
end-if
原因是试图添加一个已经存在的模块导致错误.
Reason is trying to add a module that already exists causes an error.
推荐答案
在域模式下,您可以这样做.
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
这篇关于有没有办法在使用 CLI 将模块添加到 JBoss 之前进行检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文