请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

运行mvn mybatis-generator:generate出错

运行mvn mybatis-generator:generate出错:
[INFO] Scanning for projects…
[INFO]
[INFO] ---------------------------< com.imooc:mall >---------------------------
[INFO] Building mall 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] — mybatis-generator-maven-plugin:1.3.7:generate (default-cli) @ mall —
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.862 s
[INFO] Finished at: 2019-12-02T04:22:10+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.7:generate (default-cli) on project mall: Execution default-cli of goal org.mybatis.generator:myb
atis-generator-maven-plugin:1.3.7:generate failed: A required class was missing while executing org.mybatis.generator:mybatis-generator-maven-plugin:1.3.7:generate: java/time/temporal/T
emporalAccessor
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.mybatis.generator:mybatis-generator-maven-plugin:1.3.7
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/install/mvnrepository/org/mybatis/generator/mybatis-generator-maven-plugin/1.3.7/mybatis-generator-maven-plugin-1.3.7.jar
[ERROR] urls[1] = file:/D:/install/mvnrepository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar
[ERROR] urls[2] = file:/D:/install/mvnrepository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[3] = file:/D:/install/mvnrepository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar
[ERROR] urls[4] = file:/D:/install/mvnrepository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[5] = file:/D:/install/mvnrepository/org/codehaus/plexus/plexus-utils/3.1.0/plexus-utils-3.1.0.jar
[ERROR] urls[6] = file:/D:/install/mvnrepository/org/mybatis/generator/mybatis-generator-core/1.3.7/mybatis-generator-core-1.3.7.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : java.time.temporal.TemporalAccessor
[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

Pom文件配置



org.springframework.boot
spring-boot-maven-plugin

        <plugin>
            <groupId>org.mybatis.generator</groupId>
            <artifactId>mybatis-generator-maven-plugin</artifactId>
            <version>1.3.7</version>
        </plugin>
    </plugins>

</build>

generator文件

<context id="DB2Tables" targetRuntime="MyBatis3">

    <!--        不再追加xml内容-->
    <plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />

    <commentGenerator>
        <property name="suppressAllComments" value="true"/>
    </commentGenerator>

    <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                    connectionURL="jdbc:mysql://127.0.0.1:3306/mall"
                    userId="root"
                    password="a123456">
    </jdbcConnection>

正在回答

1回答

廖师兄 2019-12-02 23:39:15

看错误应该是pom.xml里写错了,你用我的课程源码运行看看。还找不到原因,把你的整个项目push到github,我下载运行

1 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信