diff --git a/build.sbt b/build.sbt index 910b63405..01ebd1415 100644 --- a/build.sbt +++ b/build.sbt @@ -96,7 +96,13 @@ assemblyMergeStrategy in assembly := { //jrebel.webLinks += (target in webappPrepare).value //jrebel.enabled := System.getenv().get("JREBEL") != null javaOptions in Jetty ++= Option(System.getenv().get("JREBEL")).toSeq.flatMap { path => - Seq("-noverify", "-XX:+UseConcMarkSweepGC", "-XX:+CMSClassUnloadingEnabled", s"-javaagent:${path}") + if (path.endsWith(".jar")) { + // Legacy JRebel agent + Seq("-noverify", "-XX:+UseConcMarkSweepGC", "-XX:+CMSClassUnloadingEnabled", s"-javaagent:${path}") + } else { + // New JRebel agent + Seq(s"-agentpath:${path}") + } } // Exclude a war file from published artifacts diff --git a/doc/jrebel.md b/doc/jrebel.md index 4a597d929..eba28f2ff 100644 --- a/doc/jrebel.md +++ b/doc/jrebel.md @@ -28,17 +28,16 @@ You don't need to integrate with your IDE, since we're using sbt to do the servl Fortunately, the gitbucket project is already set up to use JRebel. You only need to tell jvm where to find the jrebel jar. -To do so, edit your shell resource file (usually `~/.bash_profile` on Mac, and `~/.bashrc` on Linux), and add the following line: +To do so, edit your shell resource file (usually `~/.bash_profile` on Mac, and `~/.bashrc` on Linux) and set the environment variable `JREBEL`. +For example, if you unzipped your JRebel download in your home directory, you would use: ```bash -export JREBEL=/path/to/jrebel/legacy/jrebel.jar +export JREBEL=~/jrebel/legacy/jrebel.jar # legacy agent +export JREBEL=~/jrebel/lib/libjrebel64.dylib # new agent ``` -For example, if you unzipped your JRebel download in your home directory, you whould use: - -```bash -export JREBEL=~/jrebel/legacy/jrebel.jar -``` +You can choose the legacy JRebel agent or the new one. +See [the document](https://zeroturnaround.com/software/jrebel/jrebel7-agent-upgrade-cli/) for details. Now reload your shell: