1.在用maven建ssm工程时,在pom.xml中加入以下代码
<build>
<finalName>Mybatis1</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
2.在用maven仓库,使用jdk1.8以上时在pom.xml中加入以下代码
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>