Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:generate (default-cli) on project : resource does not exist


使用mybatis-generator自动生成mapper、dao等文件时,报错如下:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:generate (default-cli) on project ssm: <properties> resource does not exist

 

错误原因是maven无法找到对应<properties> resource文件.

解决方法如下:

1.检查properties文件,每一行的行首和行末,是否有多余的空格,将其删掉;

2.在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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM