maven + mybatis + idea:java
1)報錯信息以下:mybatis
3)測試代碼以下:maven
@SpringBootApplication
public class RevertDemoApplication {
public static void generator() throws Exception
{
List<String> warnings = new ArrayList<String>();
boolean overwrite = true;
//指定 逆向工程配置文件
File configFile = new File("generatorMap.xml");
ConfigurationParser cp = new ConfigurationParser(warnings);
Configuration config = cp.parseConfiguration(configFile);
DefaultShellCallback callback = new DefaultShellCallback(overwrite);
MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config,
callback, warnings);
myBatisGenerator.generate(null);
}
public static void main(String[] args) {
SpringApplication.run(RevertDemoApplication.class, args);
try {
generator();
} catch (Exception e) {
e.printStackTrace();
}
}
}
4)檢查文件名拼寫無誤
pom文件路徑配置無誤ide
5)奔潰了2天,從網上找到了一點靈感測試
在測試類中添加了idea
使用file.createNewFile() 方法新建了一個文件,而後查看該文件的位置,發現是在項目的根目錄,把逆向配置文件移到項目的根目錄code
報錯解決!!!!!!!!!!xml