-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
打包问题 #4
Comments
怎么解决的?如果解决了告知一下。我也学习学习 |
我看到一个文章是解决类似的问题的,https://www.jb51.net/article/243231.htm,但是没有尝试 |
参考 #8 (comment) |
换一种加载方式即可 cfg.setClassForTemplateLoading(this.getClass(), "/templates"); |
问题的原因是加载模板目录方法错误,setDirectoryForTemplateLoading在IDE运行没问题,但是打包发布以后没办法从jar包直接加载文件路径 项目中只要修改两个地方 |
非常感谢,我成功了 |
打包之后运行报错:
Caused by: java.io.FileNotFoundException: src/main/resources/templates does not exist.
是不是需要修改一下模版配置文件呢,还是有其他解决办法。
The text was updated successfully, but these errors were encountered: