Quantcast
Channel: Active questions tagged charset - Stack Overflow
Viewing all articles
Browse latest Browse all 63

Copy java.nio.charset.spi.CharsetProvider from MATA-INF/services to "fat" jar of spring-boot-maven-plugin

$
0
0

I'm trying to add jcharset ([https://www.freeutils.net/source/jcharset/]) to my project, by I couldn't archive it for the last few days. Let's I describe my env:

  1. spring boot fat jar
  2. java 17
  3. docker image gcr.io/distroless/java17-debian12The library working locally but not on environment, because of differences in class loading (https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4619777). For spring boot spring-boot-maven-plugin structure is like this:enter image description here

I can change maven build plugin or something else, but not sure what the right path to add service to META-INF/classes in fat jar.

  1. java -cp with library - didn't help, it still didn't load library to SystelClassLoader
  2. add jar with library like /usr/lib/jvm/java-17-openjdk-arm64/lib/jcharset-2.1.jar - not relevant for Java after 9
  3. use some maven plugin with spring-boot-maven-plugin - didn't help
  4. Instrumentation api - but looks like I need build the second jar for that

Viewing all articles
Browse latest Browse all 63

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>