IntelliJ & Wildfly - hot deploy webapp
Asked Answered
M

1

7

I am using IntelliJ (14.0.3) and Wildfly (8).

When I recompile my Java classes, hot swapping is easy and everything works just fine. However, my HTML, JS and CSS files will not hot swap for me. I am sure it is just a configuration issue and was hoping for some help.

My HTML data is in:

<root>/<war_module>/src/main/webapp

My run/debug is setup for:

Before launch: Make, Build Artifacts

  1. Make
  2. Build 'mymodule:war' artifact
Megawatt answered 3/2, 2015 at 1:11 Comment(0)
T
11

I had the exact same problem, this is how it worked for me:

After configuring your JBoss server (Wildfly), setup an artifact of type exploded, in my case I selected Web Application: Exploded, and then in the Output directory add .war to the end of the name.

In case you need a .ear, simply select JavaEE Application: exploded instead, but anyways always remember to add manually the extension.

After setting this artifact to work with your Application Server, in the edit configurations of your Wildfly server select the option Update resources in the list of options in the section On frame deactivation.

So every time you modify and save static content, it will update these changes as soon as you focus something else outside the IDE, like the browser.

Towroy answered 30/3, 2015 at 18:53 Comment(2)
I was missing that last part: "Update Resources on Frame Deactivation". ThanksMegawatt
I was missing the 'add the extension manually' part, which basically solved every problem I ever had with exploded war deployment inside IntelliJ, including with tomcat. I also needed to delete the warfile from target with IntelliJ 2018.3, as the ide build preceding the deploy does not create the directory if a file with the same name exists.Lueluebke

© 2022 - 2024 — McMap. All rights reserved.