Minimum SpringBoot version for opensearch-project / opensearch-java

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch version 2.4.0

Describe the issue:
My project is a Springboot project and I am using the following gradle file. Everything works fine with Springboot version 3.0.0. But I got the following error when I changed it to some versions below 3.0. e.g. 2.7.2. I even tried the last version which is below 3.0.0, but still got the same error.

My question is do I have to use Springboot 3.0.0? The reason I try to avoid Springboot 3.0.0 is that when I try to upgrade it from 2.7.2 to 3.0.0, there are lots of incompatible. My project is a complicated one and I don’t think I have enough time to migrate it to Springboot at this time. Thus I am looking for a way to allow it use with Springboot 2.7.*

Configuration:
build.gradle
plugins {
id ‘java’
id ‘org.springframework.boot’ version ‘3.0.0’
id ‘io.spring.dependency-management’ version ‘1.1.0’
}

group = ‘com.example’
version = ‘0.0.1-SNAPSHOT’
sourceCompatibility = ‘17’

repositories {
mavenCentral()
}

dependencies {
implementation(“org.springframework.boot:spring-boot-starter-jetty”)
implementation(“org.springframework.boot:spring-boot-starter-web”)

implementation 'org.springframework.boot:spring-boot-starter'
implementation "org.opensearch.client:spring-data-opensearch:0.1.0"

implementation 'org.springframework.data:spring-data-elasticsearch:5.0.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

}

tasks.named(‘test’) {
useJUnitPlatform()
}

Relevant Logs or Screenshots:
2023-01-28 13:10:08.218 INFO 2087 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Elasticsearch repositories in DEFAULT mode.
2023-01-28 13:10:08.294 ERROR 2087 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getModulePrefix(ElasticsearchRepositoryConfigExtension.java:64)

The following method did not exist:

'java.lang.String org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getModuleIdentifier()'

The calling method’s class, org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension, was loaded from the following location:

jar:file:/Users/kewei/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-elasticsearch/5.0.0/86f7d0d3ac9be7d3dfef1b37a0850852c8c1d9e8/spring-data-elasticsearch-5.0.0.jar!/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.class

The called method’s class, org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension, is available from the following locations:

jar:file:/Users/kewei/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-elasticsearch/5.0.0/86f7d0d3ac9be7d3dfef1b37a0850852c8c1d9e8/spring-data-elasticsearch-5.0.0.jar!/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.class

The called method’s class hierarchy was loaded from the following locations:

org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension: file:/Users/kewei/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-elasticsearch/5.0.0/86f7d0d3ac9be7d3dfef1b37a0850852c8c1d9e8/spring-data-elasticsearch-5.0.0.jar
org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport: file:/Users/kewei/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-commons/2.7.2/9547d1234cb380234066aef60129bb2ddfdc6347/spring-data-commons-2.7.2.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension

Process finished with exit code 1