org/apache/velocity/context/Context
mybatisplus.generator.AutoGenerator
生成文件时报错如下:
请输入表名:
alarm
14:38:28.569 [main] DEBUG com.baomidou.mybatisplus.generator.AutoGenerator - ==========================准备生成文件...==========================
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/velocity/context/Context
at com.baomidou.mybatisplus.generator.AutoGenerator.execute(AutoGenerator.java:100)
at com.hqjn.base.generator.CodeGenerator.main(CodeGenerator.java:117)
Caused by: java.lang.ClassNotFoundException: org.apache.velocity.context.Context
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 2 more
是因为没有引入模板引擎:
<!-- 模板引擎 --> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity-engine-core</artifactId> <version>2.0</version> </dependency>
引入之后,maven reload