binding-docu-generator maven plugin
Large parts of a binding for eclipse smarthome can be generated automatically from the XML files you create. This is done via this maven plugin.
Using the plugin
The plugin executes at the life-cycle
package. Its aim is to generate a markdown file (give the file a name via
readmeName) from a given template (
The plugin will automatically download the templates files into the
src/main/resources/templates/ directory (you can specify the directory with the
If you want to reset the templates files or update them, simply delete them. The plugin will download the new ones.
You are welcome to contribute to this repository. Just send me a pull request.
To use Mustache without problems it was necessary to implement a strong data model. Since I did not want to extend the generated classes from JAXB, I created another data model. This also empowers us to change the way we parse our XML files later if necessary.
Generating the XML schema classes
TODO: CURRENTLY NOT WORKING ON MY LOCAL MACHINE.
This is only necessary when the .xsd-files change. This should not happen very often. You need to regenerate the schema classes. To do this, please download the new
config-description-x.x.x.xsd and modify the corresponding paths in the XML schemas. (Exchange the paths to the .xsd-files with your local paths.)
To use JAXB we need to generate Java classes with XML annotations. This can be done via the following command:
%JAVA_HOME%\bin\xjc src/test/resources/thing-description-1.0.0.xsd -b src/test/resources/bindings.xsd
The files will be created in your current working directory. Please move the contents of the package
org.eclipse.smarthome.thing_description.v1_0 into the package
Make sure to modify the namespaces of the generated
@XmlRootElement(name = "config-descriptions", namespace = "http://eclipse.org/smarthome/schemas/config-description/v1.0.0")
@XmlRootElement(name = "thing-descriptions", namespace = "http://eclipse.org/smarthome/schemas/thing-description/v1.0.0")