• 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>

  • 相关阅读:
    SmartJS 第一期(0.1)发布
    smartJS 0.1 API 讲解
    smartJS 0.1 API 讲解
    20160113006 asp.net实现ftp上传代码(解决大文件上传问题)
    20151224001 GridView 多按钮的各种使用方法
    20151221001 GridView 模板
    20151218001 雕爷自白:我为什么非要这么干
    20151210001 DataGridView 选中与被选中
    20151126001 网页中嵌入谷歌动态地图
    20151125001 询问对话框 中的文字换行
  • 原文地址:https://www.cnblogs.com/kluan/p/5934629.html
Copyright © 2020-2023  润新知