Xorty
Xorty

Reputation: 18861

IntelliJ: Automatically update resources

I am using IntelliJ IDEA to develop AngularJS app with Java back-end. HTML/JS is server from Tomcat.

Whenever I changed HTML/JS file, I hit CMD+F10 and select Update resources, then refresh my browser and everything is OK.

IntelliJ Update Dialog

I'd like to ask if there is a way that IntelliJ would do this automatically for me. I know that I can check 'Don't ask again', but sometimes I really want to Redeploy or Restart server as well ...

Upvotes: 14

Views: 11889

Answers (2)

JoseM
JoseM

Reputation: 4302

If you go into your Server Run Configuration, on the Server tab there is an option named "On frame deactivation". Set that to "Update resources" and then whenever IDEA loses focus, it will update the resources of the server.

Relevant docs from Intellij http://www.jetbrains.com/idea/webhelp10.5/updating-a-running-java-ee-application.html#update_on_frame_deactivation

Edit 8/19/2020 Thanks to Adi Gerber for providing an updated link, which is https://www.jetbrains.com/help/idea/2016.2/updating-applications-on-application-servers.html#update (the previous one doesn't work anymore)

And here is a link to the current docs as of 8/19/2020: https://www.jetbrains.com/help/idea/updating-applications-on-application-servers.html#update

Upvotes: 22

MatteoOreficeIT
MatteoOreficeIT

Reputation: 199

Another TRUE AUTOMATED APPROACH that works very well is :

  • Having an imported Maven project
  • Option: Build Tools > Maven > Importing > Import Maven Project Automatically to keep in sync IDE compiler options specified in POM ( for example maven-compiler-plugin options)
  • Plugin: File Watcher to watch for resources' updates
  • Option: Tools > File Watcher > Custom watches to copy updated files via mvn war:exploded ( in our case Javascript and HTML )
  • Option: Build > Compiler Build Project Automatically to update .class

In our case we deploy on Google Cloud App Engine Devserver which reloads files everytime they are updated

Upvotes: 1

Related Questions