GithubHelp home page GithubHelp logo

A required class was missing while executing org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1:generate: org/mybatis/generator/api/dom/xml/Element about mybatis-generator-plugin HOT 7 CLOSED

PeneyLove avatar PeneyLove commented on June 21, 2024
A required class was missing while executing org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1:generate: org/mybatis/generator/api/dom/xml/Element

from mybatis-generator-plugin.

Comments (7)

PeneyLove avatar PeneyLove commented on June 21, 2024

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1:generate (default-cli) on project nongZhen-dao: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1:generate failed: A required class was missing while executing org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1:generate: org/mybatis/generator/api/dom/xml/Element
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/Maven/mavenRepository/repository/org/mybatis/generator/mybatis-generator-maven-plugin/1.4.1/mybatis-generator-maven-plugin-1.4.1.jar
[ERROR] urls[1] = file:/D:/Maven/mavenRepository/repository/com/itfsw/mybatis-generator-plugin/1.2.12/mybatis-generator-plugin-1.2.12.jar
[ERROR] urls[2] = file:/D:/Maven/mavenRepository/repository/org/freemarker/freemarker/2.3.26-incubating/freemarker-2.3.26-incubating.jar
[ERROR] urls[3] = file:/D:/Maven/mavenRepository/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
[ERROR] urls[4] = file:/D:/Maven/mavenRepository/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
[ERROR] urls[5] = file:/C:/Program%20Files/Java/java/Java/Java/jdk1.8.0_221/lib/tools.jar
[ERROR] urls[6] = file:/D:/Maven/mavenRepository/repository/mysql/mysql-connector-java/8.0.15/mysql-connector-java-8.0.15.jar
[ERROR] urls[7] = file:/D:/Maven/mavenRepository/repository/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1.jar
[ERROR] urls[8] = file:/D:/Maven/mavenRepository/repository/org/mybatis/generator/mybatis-generator-core/1.4.1/mybatis-generator-core-1.4.1.jar
[ERROR] urls[9] = file:/D:/Maven/mavenRepository/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : org.mybatis.generator.api.dom.xml.Element
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

from mybatis-generator-plugin.

PeneyLove avatar PeneyLove commented on June 21, 2024

然后我问了一些人,大多数人说插件版本是一个问题,或者找不到父项目(更新:pom,没有解决)

from mybatis-generator-plugin.

PeneyLove avatar PeneyLove commented on June 21, 2024

打包为pom

from mybatis-generator-plugin.

PeneyLove avatar PeneyLove commented on June 21, 2024

把本项目设置为父项目

from mybatis-generator-plugin.

PeneyLove avatar PeneyLove commented on June 21, 2024

在使用com.itfsw.mybatis.generator.plugins.ModelColumnPlugin插件后会报我之前的错,把这个插件注释掉则会有一个警告
[WARNING] itfsw:插件com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin插件需配合com.itfsw.mybatis.generator.plugins.ModelColumnPlugin插件使用! [WARNING] Plugin com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin in context mysqlgenerator is invalid and will be ignored.
`

    <property name="mybatisVersion" value="3.4.0"/>
    <!-- 自动生成toString方法 -->
    <plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
    <!-- 自动生成equals方法和hashcode方法 -->
    <plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"/>

    <!-- 查询单条数据插件 -->
    <plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
    <!-- 查询结果选择性返回插件 -->
    <plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin" />
    <!-- Example Criteria 增强插件 -->
    <plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
    <!-- Example 目标包修改插件 -->
    <plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin">
        <!-- 修改Example类生成到目标包下 -->
        <property name="targetPackage" value="com.nzdao.nongzhendao.dao.ex"/>
    </plugin>
    <!-- 数据Model属性对应Column获取插件 -->
    <plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
    <!-- 逻辑删除插件 -->
    <plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin">
        <!-- 这里配置的是全局逻辑删除列和逻辑删除值,当然在table中配置的值会覆盖该全局配置 -->
        <!-- 逻辑删除列类型只能为数字、字符串或者布尔类型 -->
        <property name="logicalDeleteColumn" value="del_flag"/>
        <!-- 逻辑删除-已删除值 -->
        <property name="logicalDeleteValue" value="9"/>
        <!-- 逻辑删除-未删除值 -->
        <property name="logicalUnDeleteValue" value="0"/>

        <!-- 是否生成逻辑删除常量(只有开启时 logicalDeleteConstName、logicalUnDeleteConstName 才生效) -->
        <property name="enableLogicalDeleteConst" value="true"/>
        <!-- 逻辑删除常量名称,不配置默认为 IS_DELETED -->
        <property name="logicalDeleteConstName" value="IS_DELETED"/>
        <!-- 逻辑删除常量(未删除)名称,不配置默认为 NOT_DELETED -->
        <property name="logicalUnDeleteConstName" value="NOT_DELETED"/>
    </plugin>
    <!--optional,旨在创建class时,对注释进行控制-->
    <commentGenerator>
        <property name="suppressDate" value="true"/>
        <!--<property name="suppressAllComments" value="true"/>-->
    </commentGenerator>

    <!--jdbc的数据库连接-->
    <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
                    connectionURL="jdbc:mysql://121.5.147.143:3806/nongzhen?serverTimezone=UTC"
                    userId="root"
                    password="123456">
    </jdbcConnection>
    <!--非必须,类型处理器,在数据库类型和java类型之间的转换控制-->
    <javaTypeResolver>
        <property name="useJSR310Types" value="true"/>
    </javaTypeResolver>

    <!-- targetPackage:生成的实体类所在的包 -->
    <!-- targetProject:生成的实体类所在的路径位置 -->
    <javaModelGenerator targetPackage="com.nzdao.nongzhendao.pojo"
                        targetProject="src/main/java"/>

    <!-- targetPackage 和 targetProject:生成的 mapper 文件的包和位置 -->
    <sqlMapGenerator targetPackage="com.nzdao.nongzhendao.dao"
                     targetProject="src/main/resources"/>

    <!-- targetPackage 和 targetProject:生成的 interface 文件的包和位置 -->
    <javaClientGenerator type="XMLMAPPER"
                         targetPackage="com.nzdao.nongzhendao.dao"
                         targetProject="src/main/java"/>

    <!-- 生成对应表及类名 当下面属性为true的时候可以生成Example实例类 -->
    <table tableName="%" schema="nongzhen"
           enableCountByExample="false"
           enableUpdateByExample="false"
           enableDeleteByExample="false"
           enableSelectByExample="false"
           selectByExampleQueryId="false" >
    </table>
</context>

`

from mybatis-generator-plugin.

PeneyLove avatar PeneyLove commented on June 21, 2024

已解决

from mybatis-generator-plugin.

PeneyLove avatar PeneyLove commented on June 21, 2024

在url处加useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&verifyServerCertificate=false&useSSL=false
其中&为&符号的转义

from mybatis-generator-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.