运行mybatis-generator时报错了org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available

来源:2-4 Mybatis自动生成器使用方式

sgdy23

2019-01-10 17:14

[INFO] Scanning for projects...

[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available

[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced

[INFO]                                                                         

[INFO] ------------------------------------------------------------------------

[INFO] Building miaosha 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available

[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced

[INFO] 

[INFO] --- mybatis-generator-maven-plugin:1.3.5:generate (default-cli) @ miaosha ---

[INFO] Connecting to the Database

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.935 s

[INFO] Finished at: 2019-01-10T17:13:57+08:00

[INFO] Final Memory: 22M/228M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5:generate (default-cli) on project miaosha: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5:generate failed: Exception getting JDBC Driver: COM.ibm.db2.jdbc.app.DB2Driver -> [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/PluginExecutionException


代码已上传到github https://github.com/shawbs/miaosha-demo


写回答 关注

10回答

  • moocGeeker
    2019-01-15 14:25:54
    已采纳

    1、git clone https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin

    2、在拉下来的项目文件夹里mvn -Dmaven.test.skip -U clean install,这样就可以把lifecycle-mapping拉到本地maven仓库了

    3、重新run mybatis-generator.xml

    weixin...

    大佬 感谢

    2021-04-24 09:57:22

    共 6 条回复 >

  • 慕莱坞5288264
    2019-07-29 23:00:24
    <?xml version="1.0" encoding="UTF-8"?>
    
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>com.miaoshaproject</groupId>
      <artifactId>miaosha</artifactId>
      <version>1.0-SNAPSHOT</version>
    
      <name>miaosha</name>
    
      <url>http://www.example.com</url>
    
      <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.5.RELEASE</version>
      </parent>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
      </properties>
    
      <dependencies>
    
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- mysql-->
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>5.1.41</version>
        </dependency>
        <!-- 阿里巴巴druid数据库连接池-->
        <dependency>
          <groupId>com.alibaba</groupId>
          <artifactId>druid</artifactId>
          <version>1.1.3</version>
        </dependency>
        <dependency>
          <groupId>org.mybatis.spring.boot</groupId>
          <artifactId>mybatis-spring-boot-starter</artifactId>
          <version>1.3.1</version>
        </dependency>
    
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.11</version>
          <scope>test</scope>
        </dependency>
    
        <dependency>
          <groupId>org.mybatis.generator</groupId>
          <artifactId>mybatis-generator-core</artifactId>
          <version>1.3.5</version>
        </dependency>
        <dependency>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
        </dependency>
        <!--<dependency>
          <groupId>lifecycle-mapping</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
        </dependency>-->
    
      </dependencies>
    
    
      <build>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
          <plugins>
            <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
            <plugin>
              <artifactId>maven-clean-plugin</artifactId>
              <version>3.1.0</version>
            </plugin>
            <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
            <plugin>
              <artifactId>maven-resources-plugin</artifactId>
              <version>3.0.2</version>
            </plugin>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.8.0</version>
            </plugin>
            <plugin>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>2.22.1</version>
            </plugin>
            <plugin>
              <artifactId>maven-jar-plugin</artifactId>
              <version>3.0.2</version>
            </plugin>
            <plugin>
              <artifactId>maven-install-plugin</artifactId>
              <version>2.5.2</version>
            </plugin>
            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>2.8.2</version>
            </plugin>
            <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
            <plugin>
              <artifactId>maven-site-plugin</artifactId>
              <version>3.7.1</version>
            </plugin>
            <plugin>
              <artifactId>maven-project-info-reports-plugin</artifactId>
              <version>3.0.0</version>
            </plugin>
    
    
            <!--<plugin>
              <artifactId>lifecycle-mapping</artifactId>
              <version>1.0.0</version>
            </plugin>
            <plugin>
              <artifactId>org.eclipse.m2e</artifactId>
              <version>1.3</version>
            </plugin>-->
            <!-- -->
            <!--<plugin>
              <groupId>org.eclipse.m2e</groupId>
              <artifactId>lifecycle-mapping</artifactId>
              <version>1.0.0</version>
              <configuration>
                <lifecycleMappingMetadata>
                  <pluginExecutions>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>aspectj-maven-plugin</artifactId>
                        <versionRange>[1.0,)</versionRange>
                      </pluginExecutionFilter>
                      <action>
                        <execute />
                      </action>
                    </pluginExecution>
                  </pluginExecutions>
                </lifecycleMappingMetadata>
              </configuration>
            </plugin>-->
    
            <plugin>
              <groupId>org.mybatis.generator</groupId>
              <artifactId>mybatis-generator-maven-plugin</artifactId>
              <version>1.3.5</version>
              <dependencies>
                <!--<dependency>
                  <groupId>org.mybatis.generator</groupId>
                  <artifactId>mybatis-generator-core</artifactId>
                  <version>1.3.5</version>
                </dependency>-->
    
                <dependency>
                  <groupId>mysql</groupId>
                  <artifactId>mysql-connector-java</artifactId>
                  <version>5.1.41</version>
                </dependency>
              </dependencies>
              <executions>
                <execution>
                  <id>mybatis generator</id>
                  <phase>package</phase>
                  <goals>
                    <goal>generate</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <!-- 允许移动生成的文件-->
                <verbose>true</verbose>
                <!-- 允许自动覆盖文件 实际开发过程中不要开-->
                <overwrite>true</overwrite>
                <configurationFile>
                  src/main/resources/mybatis-generator.xml
                </configurationFile>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </project>


  • 慕莱坞5288264
    2019-07-29 22:58:58

    亲们,你们这个最后怎么解决的啊?

    战斗王子贝吉...

    我也遇到这样的问题,你怎么解决的

    2019-10-31 22:14:17

    共 1 条回复 >

  • 慕娘45556
    2019-07-11 16:26:36

    https://www.jianshu.com/p/5ac7dfaae2d0这个地址有相应的答案,

  • sgdy23
    2019-01-15 16:35:26

    刚刚看到一个答案:(好像被删除了)

    git clone https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin.git

    cd dummy-lifecycle-mapping-plugin/

    mvn -Dmaven.test.skip -U clean install


    大概就是上面3行指令结束后,重新run吧。


    晴颜 回复慕莱坞528...

    我没有用老师的这种生成方式,自己写了一个main方法加载mybatis-generator.xml文件逆向生成的

    2019-08-07 23:08:48

    共 5 条回复 >

  • 走过春秋又一夏
    2019-01-13 07:28:06

    Actually, the thing is we cannot directly use the mybatis-generator.xml downloaded online. We have to delete several lines in it and modify the directory, jdbc driver , user name and password exactly.  Sorry for my english, I don't have pinyin in library's computer

    sgdy23

    Can you understand Chinese? 你解决了这个问题吗? 或许你说的对,但我没有其它的配置文件可供参考 你有正确的mybatis-generator.xml文件吗?

    2019-01-14 14:40:52

    共 1 条回复 >

  • 走过春秋又一夏
    2019-01-13 07:17:27

    Hi, Have you found what's wrong within your code? I made the same mistake with you. 

  • qq_影_53
    2019-01-12 11:54:48

    亲测,连接驱动错了https://img1.mukewang.com/5c3964f90001970d07200181.jpg

    qq_影_5... 回复sgdy23

    可以啊 GitHub地址是https://github.com/FORyc/shop-test1.git

    2019-01-14 22:27:27

    共 4 条回复 >

  • Tye_V
    2019-01-11 17:16:26

    问题的根本原因是不存在的插件 lifecycle-mapping

    无法从任何存储库org.eclipse.m2e下载工件:lifecycle-mapping:pom:1.0.0

    您的问题的解决方案是:m2e生命周期映射未找到

    - -虽然我还是没有解决

    qq_影_5...

    题主是mybatis-generator.xml中jdbcConnerctior的连接驱动配置错了,你看看你的是不是也是这个问题

    2019-01-12 11:57:49

    共 1 条回复 >

  • qq_影_53
    2019-01-10 22:33:19

    感觉是没有吧mybatis-generator依赖进来,你把镜像换成阿里的,然后reimport一下maven试试欸

    战斗王子贝吉...

    这样也不行,到底该怎么解决

    2019-10-31 22:15:31

    共 7 条回复 >

SpringBoot构建电商基础秒杀项目

应用SpringBoot快速搭建拥有用户、商品、交易及秒杀活动的电商秒杀应用。

49064 学习 · 954 问题

查看课程

相似问题