Skip to content
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

开发的时候没有热重载 #80

Closed
14790897 opened this issue Nov 8, 2023 · 12 comments
Closed

开发的时候没有热重载 #80

14790897 opened this issue Nov 8, 2023 · 12 comments

Comments

@14790897
Copy link
Contributor

14790897 commented Nov 8, 2023

需要freemaker的热重载 (❁´◡`❁)(●'◡'●)╰(°▽°)╯

@14790897
Copy link
Contributor Author

大佬在吗

@88250
Copy link
Owner

88250 commented Nov 10, 2023

Freemarker 模板我记得开发环境(mode=dev)就是热加载的,是不是改了样式没有生效?

@14790897
Copy link
Contributor Author

image
我是在Ubuntu 服务器的tmux里运行的,现在更改.ftl文件不会自动应用

@88250
Copy link
Owner

88250 commented Nov 10, 2023

服务器日志一开始能看到这行吗?

[WARN ]-[2023-11-10 21:30:19]-[org.b3log.latke.Latkes:713]: !!!!Runtime mode is [DEVELOPMENT], please make sure configured it with [PRODUCTION] in latke.properties if deployed on production environment!!!!

@14790897
Copy link
Contributor Author

image
有的

@88250
Copy link
Owner

88250 commented Nov 10, 2023

抱歉,我记错了,这个和开发/生产模式没有关系。

我猜测你可能是修改错位置了,请参考 https://github.com/88250/symphony/blob/master/src/main/java/org/b3log/symphony/util/Templates.java

@14790897
Copy link
Contributor Author

我修改的确实是resources文件夹下的ftl文件,我明天再问问别人

@14790897
Copy link
Contributor Author

14790897 commented Nov 12, 2023

大佬,我使用下面的代码启动

mvn package
java -cp "target/symphony/lib/*;target/symphony" org.b3log.symphony.Server

修改resources目录下的代码不能立即生效,需要重新运行上面的代码才可以生效

@14790897
Copy link
Contributor Author

14790897 commented Nov 12, 2023

我发现idea是可以热重载,但vs code和命令行不行,为什么?

@14790897
Copy link
Contributor Author

👀

@88250
Copy link
Owner

88250 commented Nov 12, 2023

大概是类加载机制不一样吧,可以参考上面的代码调试看看。

@14790897
Copy link
Contributor Author

好的,我再想想

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants