hypfvieh / dbus-java

Improved version of java DBus library provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/)
https://hypfvieh.github.io/dbus-java/
MIT License
180 stars 72 forks source link

Cannot generator any code with InterfaceCodeGenerator #218

Closed jonathanjsimon closed 1 year ago

jonathanjsimon commented 1 year ago

I followed the instructions found on https://hypfvieh.github.io/dbus-java/code-generation.html and continue to get this output when trying to generate code for NetworkManager (or any other dbus path including org.bluez from the examples) instead of any generated code.

I tried with the current master.zip as instructed as well as that for the 4.3.0 tag, just in case there was a bug in the unreleased master code.

Am I doing something wrong?

JRE: OpenJDK 20.0.1 as provided by Arch java-20-openjdk Maven: 3.8.7 Working directory: /home/jsimon/Development/dbus-java/dbus-java-dbus-java-parent-4.3.0/dbus-java-utils

mvn -e exec:java -Dexec.mainClass="org.freedesktop.dbus.utils.generator.InterfaceCodeGenerator" -Dexec.executable="java" -Dexec.args="%classpath --system --outputDir classes org.freedesktop.NetworkManager /org/freedesktop/NetworkManager"
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< com.github.hypfvieh:dbus-java-utils >-----------------
[INFO] Building dbus-java-utils 4.3.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:3.1.0:java (default-cli) @ dbus-java-utils ---
Syntax: <options> [busname object] [object path]
        Options: 
        --system           | -y           Use SYSTEM DBus
        --session          | -s           Use SESSION DBus
        --outputDir <Dir>  | -o <Dir>     Use <Dir> as output directory for all generated files
        --inputFile <File> | -i <File>    Use <File> as XML introspection input file instead of querying DBus

        --enable-dtd-validation          Enable DTD validation of introspection XML
        --version                        Show version information
        --help                           Show this help

If --inputFile is given busname object argument can be skipped (or * can be used), that will force the util to extract all interfaces found in the given file.
If busname (not empty, blank and not '*') is given, then only interfaces starting with the given busname will be extracted.
hypfvieh commented 1 year ago

It will work if you remove the '%classpath' argument from -Dexec.args= parameter. I will update the documentation to address this.

jonathanjsimon commented 1 year ago

I can confirm. Removing %classpath allows the program to execute. Thanks!