Code Monkey home page Code Monkey logo

Comments (5)

sjoerdtalsma avatar sjoerdtalsma commented on June 20, 2024

Thank you for the investigation.
I looked into this and there seems to be something already setting the 'headless' state before the doclet class even gets loaded:

public class UMLDoclet extends StandardDoclet {
    static {
        System.setProperty("java.awt.headless", "true");
    }
    // ...
    public UMLDoclet() {
        super();
        this.config = new DocletConfig();
        System.out.println("Headless? java.awt.headless=" + System.getProperty("java.awt.headless")
                + ", GraphicsEnvironment.isHeadless()=" + java.awt.GraphicsEnvironment.isHeadless());
    }
}

Results in: Headless? java.awt.headless=true, GraphicsEnvironment.isHeadless()=false

The java module system also prevents us from using filthy reflection tools to try manipulate the private static GraphicsEnvironment.headless field directly.

Do you have other suggestions that will autoconfigure the built-in PlantUML behave decently?

from umldoclet.

sjoerdtalsma avatar sjoerdtalsma commented on June 20, 2024

Perhaps the maven javadoc plugin could (/should) set this system property by default?
I can't imagine any usecase for running anything non-headless from the javadoc plugin.

from umldoclet.

sjoerdtalsma avatar sjoerdtalsma commented on June 20, 2024

Results in: Headless? java.awt.headless=true, GraphicsEnvironment.isHeadless()=false

Okay, that may have been a bit premature running tests from my IDE 🫣.

Commandline maven gives me:

[INFO] --- maven-javadoc-plugin:3.6.3:jar (attach-javadocs) @ umldoclet ---
[INFO] No previous run data found, generating javadoc.
[INFO] 
Headless? java.awt.headless=true, GraphicsEnvironment.isHeadless()=true

I'll create a version where I set the java.awt.headless system property directly when loading the doclet class (first 'contact' UMLDoclet gets). It won't hurt and might even fix the issue. 🤞

from umldoclet.

sjoerdtalsma avatar sjoerdtalsma commented on June 20, 2024

@arthurvl Could you please check whether the problem still exists with version 2.1.2?

from umldoclet.

sjoerdtalsma avatar sjoerdtalsma commented on June 20, 2024

Closing this issue to lack of activity. @arthurvl feel free to re-open if you still experience this issue with the latest version.

from umldoclet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.