分享一次导入项目所遇到的各种错误:
项目本身是eclipse的maven项目,在使用IDEA打开时遇到如下几个问题:
1. 项目启动报错:
提示存放 mapper xml文件的classes找不到, because it not exist
解决方法:
在 pom文件中加入以下内容:
<resources>
<!--编译之后包含xml-->
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
2. 在解决了xml classes 问题后又出现了从没见过的 3 字节的 UTF-8 序列的字节 3 无效
解决方法:
1. 我修改了IDE File-encoding 的编码为 UTF-8 可启动后还是报同样错误
2. 在pom.xml中加入
<properties>
<!-- 设置默认编码 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
3. IDEA导入项目时, 提示不允许出现中文,最后把项目从中文目录中移了出来
最终解决了所有问题,顺利的启动