javamavenjavafxjava-11azul-zulu

What makes Maven want openjfx with Zulu Java 11 and not Zulu Java 8 for a Spring Boot project?


I have inherited a Spring Boot project where we would like to use Java 11 for testing due to the nice features added in Java 9 and 10 (var and List.of(...)).

The Maven project is split up in several parts where the code for production is set up for Java 8, and the test code for Java 11. This works nicely individually on module basis and the global build works with Java 8 (except for the tests failing to compile) and Java 10.

Now I want to compile everything from the root using Java 11 due to this being the LTS (Zulu as this is on Windows 10), and for some reason Maven now wants to pull in org.openjfx:javafx.base:jar:11.0.0-SNAPSHOT

[INFO] Building mumble-data-service-parent 1.0.0-SNAPSHOT              
[1/8]
[INFO] --------------------------------[ pom ]---------------------------------
[WARNING] The POM for org.openjfx:javafx.base:jar:11.0.0-SNAPSHOT is missing, no dependency information available
[INFO]

As the dependencies are not satisfied I cannot (at least not in a way I can think of) get Maven to tell me why it wants to do this so I have no idea where to look, and the project does not appear to reference javafx in the first place (being a Spring Boot microservice that would surprise me a bit). Hence this question.

What causes it, and how do I fix it?


As correctly deduced by Karol this issue was seen before and the fix was to upgrade the hibernate validator dependency to a newer version. All that was needed for me was to add the following property to my parent pom:

    <!-- needed for building with Java 11 -->
    <hibernate-validator.version>6.0.12.Final</hibernate-validator.version>

Solution

  • This could be caused by HV-1644 Using Hibernate Validator with Java 11 brings JavaFX on the classpath if org.hibernate.validator:hibernate-validator:jar:6.0.11.Final is part of your dependencies. Updating to 6.0.12 or newer should solve it.