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)
- Using Gradle's new file permission API is implemented in a way that prevents removal of the old API
- Support loading config yaml files embedded in env vars via spring.config.import HOT 1
- mapstruct-processor jar is missing when package from springboot2.4 HOT 3
- Reduce warnings reported by Eclipse
- Migrate class references to full javadoc links
- Use javadoc macro for links in adoc files
- Reduce warnings reported by Eclipse
- Rename one instance of DataLdapTestIntegrationTests in spring-boot-test-autoconfigure
- Rename one instance of DataLdapTestIntegrationTests in spring-boot-test-autoconfigure
- Spring Jersey does not return 404 from Controller if entity is null HOT 3
- Some @ControllerEndpoint and @RestControllerEndpoint infrastructure remains undeprecated
- @ConditionalOnProperty for branch of values not match HOT 3
- Update link to documentation for log4j-spring-boot
- Update link to documentation for log4j-spring-boot
- Move "Customize the whitelabel Error Page" how-to
- "Use Spring Data repositories" How-to incorrectly refers to Repository annotations
- Upgrade to Testcontainers 1.20.0 HOT 1
- "Use Spring Data repositories" How-to incorrectly refers to Repository annotations
- "Use Spring Data repositories" How-to incorrectly refers to Repository annotations
- Improve Configuration Experience for Multiple CacheManagers HOT 2
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.