diff --git a/doc/jrebel.md b/doc/jrebel.md index 86a0863..456497d 100644 --- a/doc/jrebel.md +++ b/doc/jrebel.md @@ -2,23 +2,15 @@ ============================= [JRebel](https://zeroturnaround.com/software/jrebel/) is a JVM plugin that makes developing web apps much faster. -JRebel is generally able to eliminate the need for the following slow "app restart" in sbt following a code change: +JRebel is generally able to eliminate the need for the slow "app restart" per modification of codes. Alsp it's only used during development, and doesn't change your deployed app in any way. -``` -> jetty:start -``` - -While JRebel is not open source, it does reload your code faster than the `~;copy-resources;aux-compile` way of doing things using `sbt`. - -It's only used during development, and doesn't change your deployed app in any way. - -JRebel used to be free for Scala developers, but that changed recently, and now there's a cost associated with usage for Scala. There are trial plans and free non-commercial licenses available if you just want to try it out. +JRebel is not open source, but we can use it free for non-commercial use. ---- ## 1. Get a JRebel license -Sign up for a [usage plan](https://my.jrebel.com/). You will need to create an account. +Sign up for a [myJRebel](https://my.jrebel.com/register). You will need to create an account. ## 2. Download JRebel @@ -27,9 +19,7 @@ ## 3. Activate -Follow the [instructions on the JRebel website](https://zeroturnaround.com/software/jrebel/download/prev-releases/) to activate your downloaded JRebel. - -You can use the default settings for all the configurations. +Follow `readme.txt` in the extracted directory to activate your downloaded JRebel. You don't need to integrate with your IDE, since we're using sbt to do the servlet deployment. @@ -41,13 +31,13 @@ To do so, edit your shell resource file (usually `~/.bash_profile` on Mac, and `~/.bashrc` on Linux), and add the following line: ```bash -export JREBEL=/path/to/jrebel/jrebel.jar +export JREBEL=/path/to/jrebel/legacy/jrebel.jar ``` For example, if you unzipped your JRebel download in your home directory, you whould use: ```bash -export JREBEL=~/jrebel/jrebel.jar +export JREBEL=~/jrebel/legacy/jrebel.jar ``` Now reload your shell: @@ -73,39 +63,26 @@ You will start the servlet container slightly differently now that you're using sbt. ``` -> jetty:start +> jetty:quickstart : -[info] starting server ... -[success] Total time: 3 s, completed Jan 3, 2016 9:47:55 PM -2016-01-03 21:47:57 JRebel: -2016-01-03 21:47:57 JRebel: A newer version '6.3.1' is available for download -2016-01-03 21:47:57 JRebel: from http://zeroturnaround.com/software/jrebel/download/ -2016-01-03 21:47:57 JRebel: -2016-01-03 21:47:58 JRebel: Contacting myJRebel server .. -2016-01-03 21:47:59 JRebel: Directory '/git/gitbucket/target/scala-2.11/classes' will be monitored for changes. -2016-01-03 21:47:59 JRebel: Directory '/git/gitbucket/target/scala-2.11/test-classes' will be monitored for changes. -2016-01-03 21:47:59 JRebel: Directory '/git/gitbucket/target/webapp' will be monitored for changes. -2016-01-03 21:48:00 JRebel: -2016-01-03 21:48:00 JRebel: ############################################################# -2016-01-03 21:48:00 JRebel: -2016-01-03 21:48:00 JRebel: JRebel Legacy Agent 6.2.5 (201509291538) -2016-01-03 21:48:00 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu. -2016-01-03 21:48:00 JRebel: -2016-01-03 21:48:00 JRebel: Over the last 30 days JRebel prevented -2016-01-03 21:48:00 JRebel: at least 182 redeploys/restarts saving you about 7.4 hours. -2016-01-03 21:48:00 JRebel: -2016-01-03 21:48:00 JRebel: Over the last 324 days JRebel prevented -2016-01-03 21:48:00 JRebel: at least 1538 redeploys/restarts saving you about 62.4 hours. -2016-01-03 21:48:00 JRebel: -2016-01-03 21:48:00 JRebel: Licensed to nazo king (using myJRebel). -2016-01-03 21:48:00 JRebel: -2016-01-03 21:48:00 JRebel: -2016-01-03 21:48:00 JRebel: ############################################################# -2016-01-03 21:48:00 JRebel: +2017-09-21 15:46:35 JRebel: +2017-09-21 15:46:35 JRebel: ############################################################# +2017-09-21 15:46:35 JRebel: +2017-09-21 15:46:35 JRebel: Legacy Agent 7.0.15 (201709080836) +2017-09-21 15:46:35 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu. +2017-09-21 15:46:35 JRebel: +2017-09-21 15:46:35 JRebel: Over the last 2 days JRebel prevented +2017-09-21 15:46:35 JRebel: at least 8 redeploys/restarts saving you about 0.3 hours. +2017-09-21 15:46:35 JRebel: +2017-09-21 15:46:35 JRebel: Licensed to Naoki Takezoe (using myJRebel). +2017-09-21 15:46:35 JRebel: +2017-09-21 15:46:35 JRebel: +2017-09-21 15:46:35 JRebel: ############################################################# +2017-09-21 15:46:35 JRebel: : -> ~ copy-resources -[success] Total time: 0 s, completed Jan 3, 2016 9:13:54 PM +> ~compile +[success] Total time: 2 s, completed 2017/09/21 15:50:06 1. Waiting for source changes... (press enter to interrupt) ``` @@ -114,12 +91,11 @@ ```html : - - GitBucket - @defining(AutoUpdate.getCurrentVersion){ version => - @version.majorVersion.@version.minorVersion - } + : ``` @@ -128,21 +104,17 @@ ``` 1. Waiting for source changes... (press enter to interrupt) -2016-01-03 21:48:42 JRebel: Reloading class 'gitbucket.core.html.main$'. -[info] Wrote rebel.xml to /git/gitbucket/target/scala-2.11/resource_managed/main/rebel.xml -[info] Compiling 1 Scala source to /git/gitbucket/target/scala-2.11/classes... -[success] Total time: 3 s, completed Jan 3, 2016 9:48:55 PM -2. Waiting for source changes... (press enter to interrupt) +[info] Compiling 1 Scala source to /Users/naoki.takezoe/gitbucket/target/scala-2.12/classes... +[success] Total time: 1 s, completed 2017/09/21 15:55:40 ``` And you reload browser, JRebel give notice of that it has reloaded classes: ``` -[success] Total time: 3 s, completed Jan 3, 2016 9:48:55 PM 2. Waiting for source changes... (press enter to interrupt) -2016-01-03 21:49:13 JRebel: Reloading class 'gitbucket.core.html.main$'. +2017-09-21 15:55:40 JRebel: Reloading class 'gitbucket.core.html.main$'. ``` ## 6. Limitations -JRebel is nearly always able to eliminate the need to explicitly reload your container after a code change. However, if you change any of your routes patterns, there is nothing JRebel can do, you will have to run `jetty:start`. +JRebel is nearly always able to eliminate the need to explicitly reload your container after a code change. However, if you change any of your routes patterns, there is nothing JRebel can do, you will have to restart Jetty by `jetty:quickstart`.