Open courteous opened 1 month ago
I have tired today manually overriding the hibernate-validator version in the POM to the latest one which is mentioned that is supported and still the maven repo did not find any supported version.
i.e.
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>7.0.4.Final</version>
</dependency>
result was
[INFO] [graalvm reachability metadata repository for org.hibernate.validator:hibernate-validator:7.0.4.Final]: Configuration directory is org.hibernate.validator/hibernate-validator/7.0.4.Final
[INFO] [graalvm reachability metadata repository for org.hibernate.validator:hibernate-validator:7.0.4.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for org.hibernate.validator:hibernate-validator:7.0.4.Final]: Latest version not found!
[INFO] [graalvm reachability metadata repository for org.hibernate.validator:hibernate-validator:7.0.4.Final]: missing.
Describe the problem
Hello I have the following question:
I have a spring boot app which can be successfully compiled and an java -jar is able to run the app without any problems.
and
I decided to move my app to the Native Image and for that I first made sure that all my java modules can be compiled as native image. All those modules were successfully compiled to native image using the native-maven-plugin. Then I decides to move the main server app to the native image again using the standard native-maven-plugin. Now the problem i discovered the compilation of the main app is one particular dependencies can not be resolved based on the reachability metadata repository in my particular case that is the hibernate-validator:8.0.2.Final.
attaching the partial compilation output below:
now in order to troubleshoot that further I decided to use the, maven-shade-plugin , and I was really surprised that once I replaced the spring-boot-maven-plugin with the maven-shade-plugin. In this case the app was compiled by the native image was !!! successful !!!! , although the same warring existed about the hibernate-validator version 8.0.2.Final. as present as well once I compiled with pring-boot-maven-plugin. Once the compilation was finished the final result was that the program was not able to run and I got the AotInitializerNotFoundException. i.e. see the stack trace below:
Everything so far is very similar to what is descried here.
Now at this point, I thought that this library (hibernate-validator 8.0.2.Final ) was not supported, but that is not the case. I found it listed as officially supported here
i.e. anything above or equal to version 7.0.4 is supported!
But for some reason that is not working for me.
I would really appreciate some guidance on how to troubleshoot this further.
In this particular case the jar hibernate-validator 8.0.2.Final is being pulled automatically because of the following dependency "spring-boot-starter-validation" which is part of the POM. i.e.
I am attaching some relative parts of the POM.