I upgraded my springboot application to springboot 3.
I see that hibernate uses the antlr version 4.10.1. But is have another dependency in my code called odl-yangtools-yang-parser which uses antlr version 4.7.1.
When I try to run my application and use the yang parser, I get the following exception
Caused by: java.lang.UnsupportedOperationException: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:56) ~[antlr4-runtime-4.10.1.jar!/:4.10.1]
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:48) ~[antlr4-runtime-4.10.1.jar!/:4.10.1]
at org.opendaylight.yangtools.antlrv4.code.gen.YangStatementLexer.<clinit>(YangStatementLexer.java:154) ~[yang-parser-impl-1.2.3.jar!/:?]
... 333 more
Caused by: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:56) ~[antlr4-runtime-4.10.1.jar!/:4.10.1]
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:48) ~[antlr4-runtime-4.10.1.jar!/:4.10.1]
at org.opendaylight.yangtools.antlrv4.code.gen.YangStatementLexer.<clinit>(YangStatementLexer.java:154) ~[yang-parser-impl-1.2.3.jar!/:?]
... 333 more
Is there a way to have both dependencies to suffice both cases?
Or is there any way to downgrade hibernate which uses 4.7.1 version of antlr4-runtime in springboot 3.
Please advice.

I downgraded the hibernate and it is working fine with my old old parser implementation.
Here is my pom.xml change