Tomcat Plugin 1.1 File –>> Settings –>> Type Plugin –>> Make sure Tomcat and TomEE Integration is checked.
Tomcat deployment directory Follow x), located in R:\programs\apache-tomcat-6.0.
Which version of IntelliJ are you using? FYI, you can run Jetty from within IntelliJ, then later deploy to Tomcat. For a preconfigured example, try a Vaadin starter web app, choosing the "Plain Java Servlet" flavor.
This cannot be done if you deploy a war with IntelliJ IDEA. However, it can be if you deploy an exploded war. In IDEA:
my-webapp-name:war
my-webapp-name:war exploded
Now anytime you make a change, IDEA will redeploy the changed file(s) when IDEA's frame is deactivated (i.e. loses focus). It does take a second or two, You'll see it in the lower status bar in IDEA. Obviously. you'll still need to refresh your web browser so it fetches the new file (unless of course if the page has an auto refresh of ajax like fetch).
A good combination with Tomcat is to set "On frame deactivation" to "Update Resources" and the "On 'update' action to either "Redeploy" or "Restart Server". That allows static pages to be quickly updated via frame deactivation, and class updated via the 'update' action.
A company named ZeroTurnaround sells JRebel which is a dynamic classloader solution. They also have a five part series on the subject that's very good.
Let me describe the sequence of actions using screenshots:
Click the add icon, select 'artifact' and then select pizza_mvc:war exploded
:
Modify 'On update action' and 'On frame diactivation':
Everytime you want to refresh your resources, press <Ctrl> + F10
If you want to update classes and resources, run Tomcat in Debug mode. In this mode IntelliJ update classes and resources without a problem (hot swap).
Got same problem. IntelliJ didn't update my project, because I run as "Run mode". When I run in debug mode and press Ctrl+F10, it updates classes and resources.
I have found a better way.
In Eclipse we have automatically build, compile + reload static files. Actually static files are served directly from src/main/webapp.
In IntelliJ instead of serving directly from src/main/webapp, there is a folder created in target, in which you will have a copy of your src/main/webapp and also other context related .. web-inf/classes /lib.
If You put instead of the target the output of exploded artifact to src/main/webapp, it will not overwrite you source files, and it will serve directly, you won't have to hit - update resources / update resources and classes
So what you need to do in IntelliJ is
After this, if you have jobs that change static files from outside IntelliJ, you will see changes immediately without going to IntelliJ and Update Resources, and for the classes you have that macro that saves, and compile(Note: You could also just hit Compile/Recompile : cmd + shift + F9 / cmd + F9 - if you have multiple opened editors will see that your dirty * editors will be non dirty, and changes(classes) will be reloaded)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With