Comments (12)
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 $ mvn spring-boot:run
?
from spring-boot.
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?
from spring-boot.
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 gradle jettyRun
where you can reload the code that you save and compile in IDE (as long as the resulting class file is copied into the correct folder). Is there anything like that in the current version of Spring Boot's gradle plugin if I use jetty instead of tomcat? I've tried gradle run
but there's no such task. Could you point me to the correct documentation if such feature exists?
Thank you.
from spring-boot.
I agree @YudhistiraArya ,is there some solution?
from spring-boot.
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).
from spring-boot.
Currently the gradle plugin only supports creating executable JARs. There is no equivalent to the maven spring-boot:run
goal.
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 (Alt + Shift + F9
I think) work for you?
from spring-boot.
As a IntelliJ user ,it works fine for me.
First add a application.properties
under resources folder with content:
spring.thymeleaf.cache: false
Then,Use IntelliJ Idea debug the application.
After edit Thymeleaf template or Java, must use CTRL+F9 to make the project.
from spring-boot.
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.
from spring-boot.
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
from spring-boot.
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.
from spring-boot.
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
compile("org.springframework.boot:spring-boot-devtools")
to the gradle.build (the correct one, not any random one).
then after finishing the rest of the steps from the link, added this line to application.properties:
spring.thymeleaf.cache= false (thanks yanhua365)
THEN when running the tomcat servlets, don't just run them, need to run them in debug mode
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
from spring-boot.
@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).
from spring-boot.
Related Issues (20)
- FileSystemProviders from jar-files are not found when running as executable jar generated via spring-boot-maven-plugin HOT 1
- Upgrade CI to Docker 26.1.0
- Upgrade CI to Docker 26.1.0
- Upgrade CI to Docker 26.1.0
- Containers not shut down between tests when using .withReuse(true) but env. does not support reuse (e.g. CI builds)
- Containers not shut down between tests when using .withReuse(true) but env. does not support reuse (e.g. CI builds)
- members of Interface TypeInformation are null when AOP and Data Rest are enabled and a bean is marked @Lazy HOT 1
- Spring Boot Actuator does not show http.server.requests in metrics endpoint after spring-boot upgrade to 3.* HOT 1
- Clarify the directory that's used by default to find Docker Compose compose.yaml HOT 2
- Virtual Threads HOT 1
- Clarify the directory that's used by default to find Docker Compose compose.yaml
- Clarify the directory that's used by default to find Docker Compose compose.yaml
- SpringBootMockMvcBuilderCustomizer can crash cryptically while collecting data that it would have discarded anyway
- SpringBootMockMvcBuilderCustomizer can crash cryptically while collecting data that it would have discarded anyway
- Upgrade to release verification tests 0.0.3
- Upgrade to release verification tests 0.0.3
- Upgrade to release verification tests 0.0.3
- R2dbcAutoConfiguration does not seem to allow setting metricsRecorder on ConnectionPool and/or ConnectionPoolConfiguration#customizer HOT 1
- Clarify docs around spring.jpa.generate-ddl
- Clarify docs around spring.jpa.generate-ddl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.