Comments (7)
[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.
然后我问了一些人,大多数人说插件版本是一个问题,或者找不到父项目(更新:pom,没有解决)
from mybatis-generator-plugin.
打包为pom
from mybatis-generator-plugin.
把本项目设置为父项目
from mybatis-generator-plugin.
在使用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.
已解决
from mybatis-generator-plugin.
在url处加useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&verifyServerCertificate=false&useSSL=false
其中&为&符号的转义
from mybatis-generator-plugin.
Related Issues (20)
- 逻辑删除支持设置id
- Upsert配合useGeneratedKeys使用触发ibatis异常 HOT 1
- 什么时候可以升级mybatis-generator-core到1.4.0啊,非常期待 HOT 3
- The alias 'Column' is already mapped to the value 'com.aaa.bbb.dao.entity.Ccc$Column' HOT 1
- OptimisticLockerPlugin does not support tables that have multiple primary keys
- LombokPlugin conflicts with MyBatis3Simple
- 能否开发支持JSON的插件,比如JSON_SET, JSON_ARRAY_APPEND之类的?
- Not working via try to eclipse plugin HOT 1
- 支持多表联合查询吗
- 使用Java API方式生成代码,报“获取插件列表失败!”
- UpsertPlugin生成的upsert开头的方法sql语义不正确
- 希望增加BaseMapper,BaseEntity 这种继承
- 数据库中decimal类型的字段会被生成为Long类型的java类字段 HOT 1
- select返回的结果会自动去掉前后空格?
- 请问批量插入开启allowMultiQueries后是否保证原子性
- 我使用rootClass属性设置继承父类,然后也是用了插件的builder,但是结果导致,生产的builder也继承了父类,有没有解决办法
- 批量插入batchInsertSelective无法返回id
- 能否增加空行插件
- com.itfsw.mybatis.generator.plugins.CommentPlugin 插件不管用 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mybatis-generator-plugin.