前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Maven 编译拷贝资源的时候提示 UTF-8 编码信息

Maven 编译拷贝资源的时候提示 UTF-8 编码信息

原创
作者头像
HoneyMoose
修改2020-10-09 16:04:36
2.5K0
修改2020-10-09 16:04:36
举报
文章被收录于专栏:CWIKIUS

如下面的提示内容。

提示的是在拷贝资源文件的时候,因为没有指定编码,将会使用 UTF-8 对编码进行转换。

代码语言:javascript
复制
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO] Copying 2 resources
[INFO] The encoding used to copy filtered properties files have not been set. This means that the same encoding will be used to copy filtered properties files as when copying other filtered resources. This might not be what you want! Run your build with --debug to see which files might be affected. Read more at https://maven.apache.org/plugins/maven-resources-plugin/examples/filtering-properties-files.html
maven-encode
maven-encode

解决办法

在你的 pom 配置文件中 maven-resources-plugin 插件配置中,添加一个

代码语言:javascript
复制
<propertiesEncoding>UTF-8</propertiesEncoding>

这个参数。如果你的 pom 配置文件没有配置过 maven-resources-plugin 插件的话,你需要将这个插件先添加进去。

具体的配置参数如下:

代码语言:javascript
复制
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <propertiesEncoding>UTF-8</propertiesEncoding>
                </configuration>
            </plugin>
maven-encode-01
maven-encode-01

上图显示了需要的配置状态。

https://www.ossez.com/t/maven-utf-8/560

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 解决办法
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档