一. 在idea中使用mybatis插件生成dao、model等,确认写了mybatis_generator.properties
文件,报错不存在,如下。
Caused by: org.apache.maven.plugin.MojoExecutionException: <properties> resource mybatis_generator.properties does not exist
解决方案:解决方法如下:
- 检查properties文件,每一行的行首和行末,是否有多余的空格,将其删掉;
- 在maven的pom.xml文件中,加入如下的<resource>配置:
<dependencies>
<!--相关的依赖文件-->
</dependencies>
<bulid>
<plugins>
<!--相关的插件-->
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>