Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:generate (default-cli) o

Posted 乐之者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:generate (default-cli) o相关的知识,希望对你有一定的参考价值。

使用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>

 

以上是关于Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:generate (default-cli) o的主要内容,如果未能解决你的问题,请参考以下文章

运行maven项目时出现一下问题:“ Failed to execute goal org.apache.maven.plugins“

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile

maven报错---Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-c

Maven多模块项目单独编译子模块项目时报错:Failed to execute goal on project

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.1.0