Search code examples
javamavendbusnetworkmanager

Java/Maven: integrating org.freedesktop.NetworkManager


Is there a published reliable way to pull the org.freedesktop.NetworkManager package into a Maven build? Searching on https://mvnrepository.com I find this but I think it's not org.freedesktop.NetworkManager and in any case the artifact no longer exists on https://jcenter.bintray.com/.


Solution

  • What is normally done in this case is to generate the code using the introspection data. There are a number of introspection XML files in the repository for NetworkManager depending on what you're attempting to control.

    If you are using the original dbus-java 2.7 bindings, you would use the CreateInterface class. If you are using the updated 3.2 bindings from hypfvieh, you can generate the code using the InterfaceCodeGenerator class. I would recommend using the 3.2 bindings, as a number of bugs have been fixed and it is available via Maven Central.