springboot-version: 3.2.1 graal-vm-version: GraalVM 17.0.9+11.1
The pom file I am using plugin:
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<buildArgs combine.children="append">
<buildArg>--enable-url-protocols=http</buildArg>
<buildArg>--pull-policy=if-not-present</buildArg>
<buildArg>--no-fallback</buildArg>
</buildArgs>
<jvmArgs>
<arg>-Djavax.xml.accessExternalDTD=all</arg>
<arg>-Dfile.encoding=UTF-8</arg>
</jvmArgs>
<environment>
<variable>LANG=en_US.utf8</variable>
</environment>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<name>${project.artifactId}:${project.version}</name>
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
<buildCache>
<volume>
<name>cache-${project.artifactId}.build</name>
</volume>
</buildCache>
<launchCache>
<volume>
<name>cache-${project.artifactId}.launch</name>
</volume>
</launchCache>
<env>
<BP_JVM_VERSION>17</BP_JVM_VERSION>
<BPE_LANG>en_US.utf8</BPE_LANG>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dfile.encoding=UTF-8 -Djavax.xml.accessExternalDTD=all -XX:+HeapDumpOnOutOfMemoryError</BPE_APPEND_JAVA_TOOL_OPTIONS>
</env>
</image>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
Print Chinese logs code:
log.info("基础数据类型强制转换:{}-{}",tClass,jsonStr);
Results of operation:
2024-01-31 11:56:06.466 [41a9cddc6d9e44e7a2a9fa5a9908dd22] [XNIO-1 task-2] INFO com.waitylyou.util.RedisUtil - ??????????:class java.lang.String-f2df16b4-7f11-4443-99da-21cdbe9560ae
build run :
mvn -Pnative spring-boot:build-image
Comment From: admintertar
linux lang :
Comment From: wilkinsona
Does the problem occur all of the time or only when building a native image?
Comment From: wilkinsona
On further reading, this appears to be a duplicate of https://github.com/spring-projects/spring-boot/issues/38936.
Comment From: admintertar
Run after building the native file
Comment From: admintertar
On further reading, this appears to be a duplicate of #38936.
I'm trying to modify it.