mvn spring-boot:run 启动的应用有中文乱码的解决办法
spring-boot
spring-projects/spring-boot: 是一个用于简化Spring应用开发的框架。适合用于需要快速开发企业级Java应用的项目。特点是可以提供自动配置、独立运行和内置的Tomcat服务器,简化Spring应用的构建和部署。
项目地址:https://gitcode.com/gh_mirrors/sp/spring-boot
·
参考如下pom.xml的配置文件加入jvm启动参数。
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<build>
<finalName>AutoEngine</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
</configuration>
<!-- mvn spring-boot:repackage -->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
强烈建议在springboot项目引入spring-boot-maven-plugin插件,该插件会对maven生成的jar包进行二次打包,打成一个fat-jar包之后我们就可以直接使用“java -jar xxx.jar”来运行服务了。
BTW:通过如下命令可以查看项目中jar包的依赖关系:
mvn dependency:tree
src/main/resources下引入logback日志配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
</configuration>
spring-projects/spring-boot: 是一个用于简化Spring应用开发的框架。适合用于需要快速开发企业级Java应用的项目。特点是可以提供自动配置、独立运行和内置的Tomcat服务器,简化Spring应用的构建和部署。
最近提交(Master分支:1 个月前 )
f72da4c7
Previously, if Actuator was being used in a non-web app such that
spring-web was not on the classpath, the app would fail to start
if Jackson 2 was present. This occured as the auto-configuration
for the EndpointJackson2ObjectMapper tried to use spring-web's
Jackson2ObjectMapperBuilder that was not present.
This commit updates the auto-configuration to back off when
Jackson2ObjectMapperBuilder is absent, aligning it with the
behavior of JacksonEndpointAutoConfiguration in 3.5.
Fixes gh-47788
1 天前
08a1d664
* pr/47784:
Fix JacksonTesterTestAutoConfiguration javadoc
Closes gh-47784
1 天前
新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
更多推荐



所有评论(0)