zoukankan      html  css  js  c++  java
  • maven编码gbk的不可映射字符

    如图,老是出现这个错误,百度说是打开源文件,更改编码格式,或者是更改File Encodings 的编码格式,或者是更改java compiler --use computer为eclipse,

    都不管用,mvn install的时候依旧错;

    在mvn install后还是不管用,后来找的资料,说是maven 编译的默认编码是gbk 的问题;

    <!-- 指明编译源代码时使用的字符编码,maven编译的时候默认使用的GBK编码, 通过project.build.sourceEncoding属性设置字符编码,告诉maven这个项目使用UTF-8来编译-->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5</version>
    <configuration>
    <source>1.7</source>
    <target>1.7</target>
    <!-- 指明编译源代码时使用的字符编码,
    maven编译的时候默认使用的GBK编码,
    通过encoding属性设置字符编码,
    告诉maven这个项目使用UTF-8来编译 -->
    <encoding>utf8</encoding>
    </configuration>
    </plugin>
    </plugins>
    OK啦
  • 相关阅读:
    使用kindeditor时,取不到值
    .net Eval 绑定截取字符串
    学习GeoServer遇到的问题及答案
    爬虫用开源代理池比较
    jenkins自动化部署gitlab上maven程序
    Notepad++编辑.sh文件
    springboot的jar在linux运行
    python3安装web.py
    linux java -jar
    linux安装nginx
  • 原文地址:https://www.cnblogs.com/jwlfpzj/p/6902538.html
Copyright © 2011-2022 走看看