当前使用版本(必填,否则不予处理)
3.5.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
无法读取到模板但是模板路径是正确的
重现步骤(如果有就写完整)
String path = this.getClass().getClassLoader().getResource("templates/controller.java.vm").getPath();
TemplateConfig template = new TemplateConfig.Builder()
// .disable()//禁用所有模板
//.disable(TemplateType.ENTITY)禁用指定模板
// .service(filePath + "/service.java")//service模板路径
// .serviceImpl(filePath + "/service/impl/serviceImpl.java")//实现类模板路径
// .mapper(filePath + "/mapper.java")//mapper模板路径
// .mapperXml("/templates/mapper.xml")//xml文件模板路路径
.controller(path)//controller层模板路径
.build();
//执行到.execute();报错 generator.global(global) .template(template) // .injection(injectionConfig) .packageInfo(packages) .strategy(strategyConfig) .execute();
报错信息
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/E:/workcode/mybatis-plus-auto/target/classes/templates/controller.java.vm'
Comment From: nieqiurong
.controller("/templates/controller.java.vm")
Comment From: qmdx
up