maven 插件、ant 任务或 gradle 插件,用于检查 rpm 是否已安装 [英] maven plugin, ant task, or gradle plugin which checks that rpm has been installed

查看:47
本文介绍了maven 插件、ant 任务或 gradle 插件,用于检查 rpm 是否已安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道可以验证 rpm 是否已经安装在 Linux 系统上的 maven 插件、ant 任务或 gradle 插件?google 结果中出现的所有插件似乎都专注于创建 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.

上下文:我们有一些 maven-native-plugin 工件,它们依赖于 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.

我的问题有点类似于 是否有 Maven获取 rpm 的插件.但是如果插件只是确认在 Red Hat Linux 系统上安装了 RPM,我就可以了,实际上获取 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.

推荐答案

你可以编写一个小的 maven 执行器规则,它只调用 Runtime.getRuntime().exec("rpm -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.

这篇关于maven 插件、ant 任务或 gradle 插件,用于检查 rpm 是否已安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆