davidmoten / openapi-to-plantuml

Converts OpenAPI 3.0 definitions to Plant UML text for visualisation of your API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make it runnable headless for CI

Oznup opened this issue · comments

Hello,

First, thanks for this wonderful work :)

I would like to run it on CI to allow people to make some beautiful PlantUML pictures from OpenAPI specifications, but I face the following issue :

Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLAY variable.
        at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
        at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
        at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
        at java.desktop/java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181)
        at net.sourceforge.plantuml.FileFormat.<clinit>(FileFormat.java:126)
        at com.github.davidmoten.oas3.puml.ConverterMain.main(ConverterMain.java:36)

Is there a simple way to run it without X11 installed or is it necessary to adapt the code ?

Thanks in advance

Nico

ah sorry didn't get to this. I don't get any failures running this sort of stuff on Github CI which is headless. Try some other things in the vein of https://stackoverflow.com/questions/10165761/java-cant-connect-to-x11-window-server-using-localhost10-0-as-the-value-of-t

Hello, I come back after months :)
Thanks for this link, it seems that my issue was due to a missing dependency (graphviz) on my environment.
I close the issue.