zoukankan      html  css  js  c++  java
  • MyBatis学习总结(15)——定制Mybatis自动代码生成的maven插件

    ======================================================================================================================
    ======================================================================================================================
    ======================================================================================================================作者:张海阳
    =======================================mybaits 自动代码生成maven插件使用说明==========================================
    ======================================================================================================================日期:2016-04-28 14:32
    ======================================================================================================================
    ======================================================================================================================


    一:将codehaus.zip解压放入相应的maven创库中,如D:javamavenmaven_repoorg


    二:**************************1.3.3-SNAPSHOT为定制版***********************************
    <!-- MyBatis代码生成插件 优化版 -->
    <plugin>
    <groupId>org.mybatis.generator</groupId>
    <artifactId>mybatis-generator-maven-plugin</artifactId>
    <version>1.3.3-SNAPSHOT</version>
    <!-- <version>1.3.2</version> -->
    <!-- <executions>
    <execution>
    <id>Generate MyBatis Artifacts</id>
    <goals>
    <goal>generate</goal>
    </goals>
    </execution>
    </executions> -->
    <configuration>
    <configurationFile>src/main/resources/mybatis-generator/generatorConfig.xml</configurationFile>
    <configurationFile>src/main/resources/mybatis-generator/generatorConfig.xml</configurationFile>
    <verbose>true</verbose>
    <overwrite>true</overwrite>
    </configuration>
    </plugin>
    <!-- 解决这个错误:Plugin execution not covered by lifecycle configuration -->
    <plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
    <lifecycleMappingMetadata>
    <pluginExecutions>
    <pluginExecution>
    <pluginExecutionFilter>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <versionRange>[1.0.0,)</versionRange>
    <goals>
    <goal>copy-dependencies</goal>
    </goals>
    </pluginExecutionFilter>
    <action>
    <ignore />
    </action>
    </pluginExecution>
    <pluginExecution>
    <pluginExecutionFilter>
    <groupId>org.mybatis.generator</groupId>
    <artifactId>mybatis-generator-maven-plugin</artifactId>
    <versionRange>[1.3.2,)</versionRange>
    <goals>
    <goal>generate</goal>
    </goals>
    </pluginExecutionFilter>
    <action>
    <ignore />
    </action>
    </pluginExecution>
    </pluginExecutions>
    </lifecycleMappingMetadata>
    </configuration>
    </plugin>


    三:**************************1.3.2为maven插件库已经有的***********************************
    <!-- MyBatis代码生成插件 老版本 -->
    <plugin>
    <groupId>org.mybatis.generator</groupId>
    <artifactId>mybatis-generator-maven-plugin</artifactId>
    <version>1.3.2</version>
    <configuration>
    <configurationFile>src/main/resources/mybatis-generator/generatorConfig.xml</configurationFile>
    <verbose>true</verbose>
    <overwrite>true</overwrite>
    </configuration>
    </plugin>


    <!-- 解决这个错误:Plugin execution not covered by lifecycle configuration -->
    <plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
    <lifecycleMappingMetadata>
    <pluginExecutions>
    <pluginExecution>
    <pluginExecutionFilter>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <versionRange>[1.0.0,)</versionRange>
    <goals>
    <goal>copy-dependencies</goal>
    </goals>
    </pluginExecutionFilter>
    <action>
    <ignore />
    </action>
    </pluginExecution>
    <pluginExecution>
    <pluginExecutionFilter>
    <groupId>org.mybatis.generator</groupId>
    <artifactId>mybatis-generator-maven-plugin</artifactId>
    <versionRange>[1.3.2,)</versionRange>
    <goals>
    <goal>generate</goal>
    </goals>
    </pluginExecutionFilter>
    <action>
    <ignore />
    </action>
    </pluginExecution>
    </pluginExecutions>
    </lifecycleMappingMetadata>
    </configuration>
    </plugin>
  • 相关阅读:
    Spring Boot 配置加载顺序详解
    JVM总结篇
    nginx负载均衡的策略
    布隆过滤器的方式解决缓存穿透问题
    Spring Cloud Eureka自我保护机制(服务无法剔除)
    缓存穿透,缓存击穿,缓存雪崩解决方案分析
    高并发秒杀系统总结
    Linux环境进程间通信(一)
    HDU 1695 GCD(容斥定理)
    数据结构精要------冒泡与直接排序算法
  • 原文地址:https://www.cnblogs.com/zhanghaiyang/p/7213136.html
Copyright © 2011-2022 走看看