ANTLR initialization warning logs following Hibernate 6.6.53.Final upgrade
search cancel

ANTLR initialization warning logs following Hibernate 6.6.53.Final upgrade

book

Article ID: 445141

calendar_today

Updated On:

Products

VMware Tanzu Spring Essentials

Issue/Introduction

A dependency convergence error or ANTLR check warning occurs at runtime or during the build process. Enforcing a strict Maven Enforcer DependencyConvergence rule causes the build to fail outright before compilation or tests with the following error:

[ERROR] Rule 3: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed
[ERROR] Dependency convergence error for org.antlr:antlr4-runtime:jar:4.13.2. Paths to dependency are:
[ERROR] ...spring-boot-starter-data-jpa:3.5.15 -> hibernate-core:6.6.53.Final -> antlr4-runtime:4.13.2
[ERROR] and
[ERROR] ...spring-boot-starter-data-jpa:3.5.15 -> spring-data-jpa:3.5.12 -> antlr4-runtime:4.13.0

Additionally, a warning appears at runtime: 

ANTLR Tool version 4.13.2 ... does not match the current runtime version 4.13.0

Environment

 

  • Spring Boot 3.5.15

  • Spring Data JPA 3.5.12

  • Hibernate ORM 6.6.53.Final

 

Cause

Spring Boot 3.5.15 manages Hibernate ORM 6.6.53.Final. Hibernate ORM pulls in org.antlr:antlr4-runtime:4.13.2. However, Spring Data JPA 3.5.12 declares ANTLR4 version 4.13.0. Hibernate 6.6.53.Final unexpectedly bumps the ANTLR dependency from 4.13.0 to 4.13.2. The version difference places two conflicting versions of antlr4-runtime on the classpath.

 

Resolution

Upcoming Fix

A formal backport aligning the ANTLR 4.13.2 dependency is currently pending for the Spring Data JPA 3.5.x maintenance line. Once released, upgrading to the patched Spring Data JPA version (such as 3.5.13 or the subsequent Spring Boot release 3.5.16) resolves the dependency convergence issue natively without requiring the manual dependency overrides listed above.

Update to the scheduled Spring Boot 3.5.x release (target date: June 25, 2026). This release will contain dependency management updates to realign Hibernate and Spring Data JPA versions, eliminating the initialization mismatch.

Workaround

If you cannot wait for the scheduled release, you can force the ANTLR version to match the requirements of your environment by overriding the dependency management in your build configuration:

  • For Maven:
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-runtime</artifactId>
                <version>4.13.2</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
  • For Gradle:
    constraints {
        runtime('org.antlr:antlr4-runtime:4.13.2') {
            because 'Hibernate 6.6.53.Final requires ANTLR 4.13.2'
        }
    }