Soccertrash
Soccertrash

Reputation: 1901

IntelliJ, JRebel, Maven and a JEE 6 application

My setup is

I configured the application in IntelliJ in a way that the ear gets deployed. The ear "target" folder looks like this target/classes/ target/appEar/appWeb-version-Snapshot.war/ target/appEar/lib/ target/appEar/META-INF

In the default configuration JRebel listens for changes in the classes/ folder. When I change something in the web module, and build this, the classes are only updated in appWeb/target/classes/ but not in appEar/target/appEar/appWeb-version-Snapshot.war/.

If I want to update those classes I have to select "Build Artifacts" in IntelliJ after building the project.

To sum up, I have to do these steps for a hot code replacement:

  1. (once) Configure JRebel correctly.
  2. Make project
  3. Build Artifacts

This whole procedure appears to be too complicated to me. Does anyone have a clue how to setup IntelliJ/Maven/Glassfish/JEE/JRebel correctly? I have not found an example containing all my tools. I'd like to have only one action for the code replacement, not two.

Upvotes: 0

Views: 244

Answers (2)

Joonas Vali
Joonas Vali

Reputation: 766

There's "build on make" checkbox in your project artifact settings, that will always recreate your artifact on compiling, if that's what you are looking for. However JRebel should remap where your application is reading class files and resources based on rebel.xml, so you probably should just rewrite rebel.xml to look for classes where they are compiled to, not where they end up after building the artifact.

Upvotes: 1

Risto Pärnapuu
Risto Pärnapuu

Reputation: 124

Why do you need to Build Artifacts every time?

Your war should contain the rebel.xml that maps to the classes in /target/classes folder.

When you make changes to said classes, your server then knows to load the changes from those classes.

So you only need to build your project in order to see the changes assuming your rebel.xml classpath points to /target/classes.

Upvotes: 0

Related Questions