mybatis-plus 错误java.lang.NoClassDefFoundError: org

使用mybatis-plus自动生成文件的时候,报下面的错误:

Disconnected from the target VM, address: ‘127.0.0.1:57082’, transport: ‘socket’
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/velocity/context/Context
at com.baomidou.mybatisplus.generator.AutoGenerator.execute(AutoGenerator.java:96)
at com.spek.common.generator.TestMybatisPlus.main(TestMybatisPlus.java:81)
Caused by: java.lang.ClassNotFoundException: org.apache.velocity.context.Context
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

环境:mybatis-plus 3.2.0

原因1:是缺少了依赖,解决方案如下:

pom.xml文件当中加入velocity的依赖

 <!-- 模板引擎 -->
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
            <version>2.0</version>
        </dependency>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐