pbarker
07/11/2024, 9:45 AMpuneetbehl
07/11/2024, 2:49 PMorg.elasticsearch:7.3.0 and org.apache.lucene:8.1.0 are pulled in:
1. Force Specific Versions:
In the build.gradle file, force the specific versions of Elasticsearch and Lucene to be used.
configurations.all {
resolutionStrategy {
force 'org.elasticsearch:elasticsearch:7.3.0'
force 'org.apache.lucene:lucene-core:8.1.0'
}
}
2. Exclude Older Versions:
Ensure that any older versions of these libraries are excluded from the transitive dependencies of other plugins or libraries. You can do this by adding exclude clauses in your dependencies:
dependencies {
implementation('your.dependency') {
exclude group: 'org.elasticsearch', module: 'elasticsearch'
exclude group: 'org.apache.lucene', module: 'lucene-core'
}
}
3. Check Transitive Dependencies:
Use the dependencyInsight task in Gradle to check for any transitive dependencies that might be pulling in older versions:
./gradlew dependencyInsight --dependency org.elasticsearch --configuration compileClasspath
./gradlew dependencyInsight --dependency org.apache.lucene --configuration compileClasspath
This will give you detailed information on which dependencies are pulling in the versions of org.elasticsearch and org.apache.lucene.
By using these steps, you should be able to pinpoint and resolve issues with older versions of Elasticsearch and Lucene being pulled into your project, ensuring that the correct versions are used with the elasticsearch-plugin:3.0.2 during your migration from Grails 3 to Grails 4.pbarker
07/11/2024, 2:52 PMcompile("org.grails.plugins:elasticsearch:3.0.1") {
exclude group:'elasticsearch', module:'elasticsearch'
exclude group:'elasticsearch.client', module:'elasticsearch.client'
}
implementation 'org.elasticsearch:elasticsearch:7.3.0'
implementation 'org.elasticsearch.client:elasticsearch-rest-client:7.3.0'
implementation 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.3.0'pbarker
07/11/2024, 2:54 PMpbarker
07/11/2024, 3:20 PMTimestamp into a full date string but failing because there's no toCalendar() method on Timestamp.
Wondering if I'm missing some other dependency issue with Groovy itself getting confused.puneetbehl
07/11/2024, 5:08 PMpbarker
07/11/2024, 5:14 PMTimestamp property.
I've changed the marshalling (JSONDomainFactory line 167) in my own branch:
// TimeZone.setDefault(TimeZone.getTimeZone('UTC'))
// res = res.toCalendar().getTime().format("yyyy-MM-dd'T'HH:mm:ss'Z'")
ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC)
res = utc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'"))
and that seems to work but I don't know if folks are using later Java versions, etc. which might break for them.pbarker
07/11/2024, 5:14 PMres.toCalendar() that fails with a missing method exception.