maven package Chinese garbled

When the va project provides a class library for a third party, in the prepared jar package, when the third party calls it, the Chinese garbled characters are taken out, as shown below:


Check that the project encoding type is utf-8, and the following log appears when packaging:

Unmappable characters that encode GBK

 

 
Some files are encoded as GBK, the solution is as follows: (set the encoding type to utf-8 when packaging)

 

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-compiler-plugin</artifactId>  
        <version>3.6.2</version>  
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>  
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-resources-plugin</artifactId>  
        <version>3.0.2</version>  
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>  
    </plugins>
  </build>

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326036800&siteId=291194637