maven编译时报错,后面发现代码是用GBK编码编写,maven默认是用utf-8来编译。修改pom.xml
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> <encoding>GBK</encoding> </configuration> </plugin> </plugins> </build>
<encoding>GBK</encoding>