Build server + JRE Extensions

48 Views Asked by At

I'm looking to build a javaFX app with headless unit-testing with Monocle and Maven. I've been able to get headless testing to work locally with building the monocle jar myself and loading it into my /Extensions java folder as specified here: JavaFX + maven + TestFX + monocle don't work together. But I don't own the build servers so it will be difficult for me to install Monocle into the Java extensions folder. I'm looking for a work around.

I am using Maven and tried using the tag https://maven.apache.org/pom.html#Extensions to include monocle:

<extensions>
    <extension>
        <groupId>org.testfx</groupId>
        <artifactId>openjfx-monocle</artifactId>
        <version>8u76-b04</version>
    </extension>
</extensions>  

This doesn't work, even with a separate dependency in the tag. I also tried including the monocle jar in the source code and including it with the java.ext.dirs parameter:

<argLine>-Dtestfx.robot=glass -Dglass.platform=Monocle -Dmonocle.platform=Headless -Dprism.order=sw -Dheadless.geometry=1600x1200-32 -Djava.ext.dirs=:<path>/monocle-jars</argLine>

But this gives me this error:

java.lang.NoClassDefFoundError: javafx/application/Application

I think that changing to a custom java.ext.dirs value causes the javafx libs to not be found.

Any suggestions on how to build this without having to manually install the Monocle Java extension?

0

There are 0 best solutions below