itfsw / mybatis-generator-plugin

Mybatis Generator 代码生成插件拓展,增加:查询单条数据插件(SelectOneByExamplePlugin)、MySQL分页插件(LimitPlugin)、数据Model链式构建插件(ModelBuilderPlugin)、Example Criteria 增强插件(ExampleEnhancedPlugin)、Example 目标包修改插件(ExampleTargetPlugin)、批量插入插件(BatchInsertPlugin)、逻辑删除插件(LogicalDeletePlugin)、数据Model属性对应Column获取插件(ModelColumnPlugin)、存在即更新(UpsertPlugin)、Selective选择插入更新增强插件(SelectiveEnhancedPlugin)、Table增加前缀插件(TableSuffixPlugin)、自定义注释插件(CommentPlugin)、增量插件(IncrementsPlugin)、查询结果选择性返回插件(SelectSelectivePlugin)、乐观锁插件(OptimisticLockerPlugin)、LombokPlugin等拓展。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

集成gradle

mychao opened this issue · comments

项目中现在用到了gradle、用到了官方的generator,如何再引入这个插件,还请执教,谢谢

@itfsw 楼主,请问gradle如何集成?🙏

好像只能用ant去做集成,具体你可以参考官方文档

Hi,

I'm using the Gradle to develop MyBatis Generator plugins
with @itfsw 's great library. Thank you very much!!!

the link below is a sample build.gradle i'm using
https://gist.github.com/masa-kunikata/daaf0f51a8ab9b808f61805407e1654c

1, prepare your generatorConfig.xml and place it
to the path mybatisGenerator{configFile =specified.
2, gradle init to make a Gradle project folder.
3, replace the build.gradle file
4, you can do
gradle mbGenerator
task to generate soruce files.

Hope this helps.

Execution failed for task ':mbGenerator'.
> Could not resolve all files for configuration ':mybatisGenerator'.
   > Could not resolve project :.
     Required by:
         project :
      > Cannot choose between the following variants of project ::
          - productionRuntimeClasspath
          - runtimeElements
        All of them match the consumer attributes:
          - Variant 'productionRuntimeClasspath' capability com.bixi:trade:1.0-SNAPSHOT:
              - Unmatched attributes:
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
          - Variant 'runtimeElements' capability com.bixi:trade:1.0-SNAPSHOT:
              - Unmatched attributes:
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.jvm.version '14' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it

I met the question, copy it from the reference.
jvm: jdk 14

please give me help