<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.