MAVEN filter garbled, Malformedbytesequenceexception:invalid byte 3 of 3-byte UTF-8 sequence.

Source: Internet
Author: User

<plugins><plugin><groupid>org.apache.maven.plugins</ groupid><artifactid>maven-war-plugin</artifactid><version>2.1-beta-1</version>< Configuration><warname>admingift</warname><webresources><resource><directory> ${basedir}/src/main/webapp/web-inf</directory><includes><include>*.xml</include>< Include>**/*.xml</include></includes><filtering>true</filtering><targetpath> web-inf</targetpath></resource><!--local jar copy to Lib under--><resource><directory> /lib</directory><includes><include>*.jar</include><include>**/*.jar</include ></includes><targetPath>WEB-INF/lib</targetPath></resource></webResources> <webappdirectory>target/admingift</webappdirectory></configuration></plugin> 

Above is the configuration of my Maven war plugin.

By wart filter after the appearance of the Chaos Mom, start error. Malformedbytesequenceexception:invalid byte 3 of 3-byte UTF-8 sequence.

The point of general attention is:

1, check whether the file is Fitler with Utf-8 BOM head, remove BOM head, with the possibility of error

2, Windows Maven version of the war plug-in, 2.1-bata-1 has a problem, it has a problem with encoding identification, suspected to be in accordance with ISO-5589-1 parsing, fitler after the file 16 binary view as 3f, resulting in black hole phenomenon

3, online A lot of solutions are changed to GBK, this is a solution, if you want to continue to use UTF-8 encoding, please modify the war filter, and do not forget the resource plug-in encoding settings.

MAVEN filter garbled, Malformedbytesequenceexception:invalid byte 3 of 3-byte UTF-8 sequence.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.