1.在idea16中使用mavn编译一个包含groovy的项目,中文字符出错。在已经百度之后添加了几个字符集
编译时的字符
<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>UTF-8</encoding>
</configuration>
</plugin>
maven 默认编码相关
<properties>
<!-- 文件拷贝时的编码 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- 编译时的编码 -->
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
groovy插件编码
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<providerSelection>2.0</providerSelection>
<sources>
<fileset>
<directory>${pom.basedir}/src/main/java/com/k/bmpt</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</fileset>
</sources>
<sourceEncoding>UTF-8</sourceEncoding>
</configuration>
</execution>
</executions>
</plugin>
编译出错截图
代码出错截图
2.请问还有什么编码没有考虑到吗
源代码文件本身的编码