Personally, when executing an order, mvn clean install often encounters
Illegal characters: \65279 illegal expressions start and so on some strange mistakes.
Personally, consider the encoding format of your MAVEN configuration first.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
To confirm that the above <project.build.sourceEncoding> content is already in the Pom file, add the following (if the relevant content of Maven-compiler-plugin is included, You only need to add a portion of the red font to the appropriate location):
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
Attention:
1. Also specify the <project.build.sourceEncoding> properties and <encoding> method can be applied to Maven2 and Maven3.
2, in the Maven3 can only add <project.build.sourceEncoding> properties without specifying <ENCODING>, that is, can solve the compilation problem. If you specify only <encoding> compile without errors, the following warning appears. It is recommended to either specify or only specify the former. The warning message is as follows:
[WARNING] Using platform Encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
3. In Maven2, if only the <project.build.sourceEncoding> attribute is specified, compile error, if only specify <encoding> compile no error, but there will be a warning similar to the 2nd, It is recommended that both be specified to avoid any impact on the operation. Execute MVN, generate a good jar package and reference this jar and its source jar in other projects, if it is garbled, it may be the configuration problem of Eclipse, confirm windows->preferences->general->workspace- >text file encoding is set to UTF-8 confirm Windows->preferences->general->content types-> Right context Types tree, open Text, Select Java Source File, enter UTF-8 in the default encoding input box below, point to update