问题描述
是任何人都知道一个Maven插件,Ant任务,或gradle这个插件,它可以验证一个rpm已经安装了Linux系统上的?在谷歌搜索结果上来的所有插件似乎着力打造的RPM,而不是检查RPM依赖例如
Is anyone aware of a maven plugin, ant task, or gradle plugin which can verify that an rpm has already been installed on a Linux system? All the plugins coming up in google results seem to be focused on creating RPMs rather than checking for RPM dependencies e.g.
- C-构建插件
- RPM-Maven的插件
- c-builds plugin http://mojo.codehaus.org/cbuild-parent/
- rpm-maven-plugin http://mojo.codehaus.org/rpm-maven-plugin/index.html
上下文:我们有一些Maven的本机神器插件依赖于从OpenSSL的-DEVEL RPM的/usr/include/openssl/ssl.h和/usr/lib/libssl.a。我想一个方法来验证的OpenSSL DEVEL RPM已安装。
Context: we have some maven-native-plugin artifacts which depend on the /usr/include/openssl/ssl.h and /usr/lib/libssl.a from the openssl-devel RPM. I'd like a way to verify that the openssl-devel RPM has been installed.
我的问题是一种类似于。但我没关系,如果该插件就可以印证一个RPM安装了Red Hat Linux系统上,实际上在获取RPM只会是一个不错的。
My question is kind of similar to Is there a Maven plugin to fetch an rpm. But I'm okay if the plugin just confirms that an RPM is installed on a Red Hat Linux system, actually fetching the RPM would just be a nice to have.
推荐答案
您可以写一个小行家执法规则,只是调用调用Runtime.getRuntime()。EXEC(转-q的OpenSSL DEVEL),并解析输出。它的简单和快捷。如果你没有找到RPM执法者可以打破建立,给你一个头了。
You can write a small maven enforcer rule that just calls Runtime.getRuntime().exec("rpm -q openssl-devel") and parse the output. It's simple and fast. If you don't find the rpm the enforcer can break the build and give you a heads up.
- http://maven.apache.org/enforcer/maven-enforcer-plugin/
- http://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html
这篇关于Maven插件,Ant任务,或gradle这个插件,它会检查RPM已安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!