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
Hot Redeploy and Command Line Running from Gradle #43
Comments
I've just found Running applications section in https://github.com/SpringSource/spring-boot/tree/master/spring-boot-tools/spring-boot-maven-plugin. Does the gradle plugin has the equivalent of |
Yes the gradle plugin has identical features, but that's about packaging jars and executing them, not hotswapping code in an IDE. Hotswapping chages in a running app is an IDE feature as far as I know, so if it works for other apps it will work for these ones. Unless I'm missing something there is nothing we can do to help in Spring Boot itself. Do you agree? |
Hi dsyer, My mistake for the running from IDE issue, I agree that one is not a Spring Boot issue. Currently, what I'm trying to achieve here is something similar with Thank you. |
I agree @YudhistiraArya ,is there some solution? |
Grails uses spring-loaded to reload classes compiled by another process. That should be easy to set up manually (it's just a java agent jar and the docs are pretty good). We were talking about maybe making it a feature (eg command line option) of the Boot tools support, so I guess that would include gradle as well as maven. I'm not really a gradler, so someone else will have to answer the question of how to run from source with gradle (or you can maybe figure it out by looking at the gradle plugin source code). |
Currently the gradle plugin only supports creating executable JARs. There is no equivalent to the I am not an IntelliJ user but with eclipse at least you only get hot-swap code support when debugging an application. Does running in debug ( |
As a IntelliJ user ,it works fine for me. First add a
Then,Use IntelliJ Idea debug the application. After edit Thymeleaf template or Java, must use CTRL+F9 to make the project. |
There is still an outstanding feature request here (for running from command line with gradle), but since it isn't relevant to the original topic of hot redeploy, I think we can close this issue and come back to the gradle plugin in another if there is demand. I don't think it is difficult to run a java main method from gradle. |
It's not clear for me why this ticket has been closed. This ticket is about hot swap and (as I understand) it's still not implemented |
There is already support for reloading static resources with "gradle bootRun". If you are talking about reloading classes, the answer hasn't changed - IDEs have that feature in debug mode, and there is spring-loaded for the command line (and a separate issue for that as well). So I don't see any reason to re-open this after 4 months. |
sorry for posting here, but it seemed relevant. I followed this link: https://dzone.com/articles/spring-boot-application-live-reload-hot-swap-with (had to alter the first step to do the same thing but with gradle i.e. add then after finishing the rest of the steps from the link, added this line to application.properties: spring.thymeleaf.cache= false (thanks yanhua365) After doing all of the above, this works by: when servlets are running in intellij -make your UI code change -save it (in my case i was using notepad++ not intellij - go back to intellij (just bring the window into focus) - then go back to browser and refresh the browser is it possible to do the hot swap/redeploy without bringing IntelliJ into focus? i.e. i would just like to run the tomcat servlets, and then minimise intelliJ and never use it again |
@Dmon1Unlimited this issue was closed almost 4 years ago. Please ask usage questions on Stack Overflow (and read the user guide section on devtools before doing anything). |
Is it possible to hot redeploy when you run through the main class? I already searched the repository for any possible mention of hot redeploy and couldn't find any. This is probably just an understanding gap on my side.
How to reproduce:
@CompileStatic
)org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT
)I'm sorry if I do something stupid above. Please correct me if I'm wrong.
Thank you.
The text was updated successfully, but these errors were encountered: