Continuation of Which ReastEasy 4 client dependencies are needed?
build.gradle
plugins {
id 'org.openjfx.javafxplugin'
id 'java'
}
repositories {
jcenter()
mavenCentral()
}
sourceCompatibility = 14
targetCompatibility = 14
ext.resteasyVersion = "4.5.8.Final";
dependencies {
compile "org.jboss.resteasy:resteasy-client:$resteasyVersion"
compile "org.jboss.resteasy:resteasy-jackson2-provider:$resteasyVersion"
}
After executing the jar
task and running the jar, an error is thrown when trying to create JAX-RS requests:
javax.ws.rs.ProcessingException: RESTEASY003215: could not find writer for content-type application/json type: java.lang.String
This was deemed to be the result of conflicts of service files, resulting in only 1 being packaged. When using the ShadowJar plugin, the solution is to configure it with
shadowJar {
mergeServiceFiles()
}
(see MessageBodyWriter not found error for Jersy / Jetty server), but this does not work for this plugin's jar generation.
How to resolve this conflict?