Question

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.

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.

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top