Closed jetztgradnet closed 1 year ago
I found a local solution: creating a jar based on jsonsurfer with antlr shaded in a different package and using this instead of the original one.
jsonsurfer-shaded
within my project with the following build.gradle file:plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation group: 'com.github.jsurfer', name: 'jsurfer-all', version: '1.6.4'
implementation group: 'com.github.jsurfer', name: 'jsurfer-core', version: '1.6.4'
}
shadowJar {
relocate 'org.antlr.v4', 'com.github.jsurfer.shaded.org.antlr.v4'
}
build.gradle
file I am referencing this shaded project instead of the original one:
// ...
dependencies { // ... other dependencies
// shaded version of jsonsurfer implementation project(path: ':jsonsurfer-shaded', configuration: 'shadow') }
//...
A similar approach should be possible for Maven projects as well.
Updating `antlr` might still make sense for other users, though.
Hi! I'm using JsonSurfer as a transitive dependency of CARML within an AWS Lambda application based on the Quarkus framework. Unfortunately, Quarkus uses a different, higher version of ANTLR (4.10.1), which leads to this error when running the app:
Fixing the version of antlr to 4.7.2 as used by JsonSurfer does not work for Quarkus.
Would it be possible to either update antlr (which would possibly lead to problems by other users of this library) or provide
jsonsurfer-core
with antlr shaded into the jar? The latter would provide maximum compatibility to everybody while getting rid of this (external) dependency. This could possibly also be done as a variant with a-shaded
classifier?