Deployed War Deployment with IntelliJ Idea, Maven, Tomcat and JRebel

I am developing a web application with IntelliJ Idea 12, Maven, JRebel and Tomcat. To take advantage of JRebel by automatically reloading changes to Spring beans, I used the deployed war deployment provided by Intellij below

IntelliJ exploded war deployment

Thanks to the Maven module, IntelliJ has exactly followed the Maven convention for compiling Java files in the output folder (target / classes) , which is DIFFERENT for the parsed webapp directoy (target / spring-mvc-showcase / webapp / WEB-INF / classes) . As a result, Tomcat and JRebel are unable to reload changes to these new classes.

At the moment I have temporarily configured the IntelliJ output folder to point to the WEB-INF / classes folder so that the changes can be reloaded. As I don't want to violate Maven conventions, can anyone tell me a more elegant solution?

target (Maven generated artifact directory)
  |
   -- classes (compiled)
  |
   -- spring-mvc-showcase (exploded webapp directory)
           |
            -- WEB-INF
                 |
                   -- classes

      

+3


source to share


3 answers


Once you've configured it correctly, when you start Tomcat, you should see something like this:

[2013-01-23 15:39:12] JRebel: Directory '/home/xxx/workspace/xxx/trunk/target/classes' will be monitored for changes.
[2013-01-23 15:39:12] JRebel: Directory '/home/xxx/workspace/xxx/trunk/src/main/webapp' will be monitored for changes.

      



Then I change something every time, instead of running the maven package, I do the "Make Project" update (in IDEA) // / and the setup will automatically reload its classes.

+2


source


Is the IntelliJ IDEA JRebel plugin installed? It adds the "Generate rebel.xml" action. This will create a rebel.xml file that should end in WEB-INF / Classes in the deployment and this will map the classes to the location where IDEA compiles them.



+1


source


Here's an easy way to quickly start hot deployments using IDEA, Jrebel and maven-tomcat. Hot deploy IDEA web application using JRebel and tomcat7-maven-plugin

0


source







All Articles