Search code examples
imagemaventextdocumentation-generation

Maven to generate an image from an xm


Does anyone know a solution that generates an image (png or something else) from a text file (more precisely an XML) using Maven?

I frequently change some XML and would like to include it into the automatically generated documentation of a project.


Solution

  • I found a partial solution which is not perfect but does the job in such a way I can live with. The solution consists of two elements:

    1. I let Maven execute an external program using the exec-maven-plugin (hint taken from How do I execute a program using Maven?)
    2. The external program is fed with the XML and generates a documentation including an image (originally I would like to have a pure image, however, I can live with the PDF). For this purpose, I use Oxygen (see https://www.oxygenxml.com/doc/versions/19.1/ug-editor/topics/documentation-XML-Schema-command-line.html)

    For step 2, if anyone has a better solution, it would be welcome.