benstpierre
benstpierre

Reputation: 33591

Jrebel/SBT how to recompile webapp without restart

So I have figured out how to run an SBT demo project with

>SBT

>container:start

I could do a

>container:restart

Every time I make a code change but this is why I installed JREBEL. I simply added the following option "-javaagent:/usr/bin/jrebel/jrebel.jar" to /opt/local/bin/sbt.sh which seems to load Jrebel fine.

The only problem I have now is how to tell my application to recompile, possibly automatically so JRebel can pick up the changes and reload my webapp as needed.

Any ideas?

Upvotes: 2

Views: 888

Answers (2)

Jan van den Berg
Jan van den Berg

Reputation: 79

If you can't use JRebel in the current situation, you can consider using DCEVM which enables better hot-swapping of code. With the sbt target

~compile

it should be picked up immediately.

Upvotes: 3

benstpierre
benstpierre

Reputation: 33591

Apparently just running compile from within the sbt console I started with JRebel enabled and started my container (via container:start) and refreshing my web page works.

Upvotes: 3

Related Questions