mybatis-generator 逆向生成 有日志输出,但是pojo.dao没有生成

最近由eclipse转战idea,将遇到的坑列出,以供后人铺路。

1; 读取配置不同  eclipse 直接放在src 文件下能读取到,idea则读取不到需要获取classpath路径

//eclipse  读取 mybatis 配置文件
File configFile = new File("generatorConfig.xml"); 
//idea 读取方式
String file=Thread.currentThread().getContextClassLoader().getResource("").getPath();		
File configFile = new File(file+"generatorConfig.xml");

2  配置成功后  运行程序 有日志输出,但是没有pojo  和dao  生成   需要使用绝对路径  以  pojo  为例    dao  亦然

//eclipse

		
			
			
			
			




//idea  使用绝对路径

		
		
			
			
			
			
		

 

PS:  windows中    使用.\       linux  使用   ./

你可能感兴趣的:(后端)