Merge pull request #1852 from int128/jrebel

Add support for new JRebel agent
This commit is contained in:
Naoki Takezoe
2018-01-24 02:02:09 +09:00
committed by GitHub
2 changed files with 13 additions and 8 deletions

View File

@@ -96,7 +96,13 @@ assemblyMergeStrategy in assembly := {
//jrebel.webLinks += (target in webappPrepare).value //jrebel.webLinks += (target in webappPrepare).value
//jrebel.enabled := System.getenv().get("JREBEL") != null //jrebel.enabled := System.getenv().get("JREBEL") != null
javaOptions in Jetty ++= Option(System.getenv().get("JREBEL")).toSeq.flatMap { path => javaOptions in Jetty ++= Option(System.getenv().get("JREBEL")).toSeq.flatMap { path =>
if (path.endsWith(".jar")) {
// Legacy JRebel agent
Seq("-noverify", "-XX:+UseConcMarkSweepGC", "-XX:+CMSClassUnloadingEnabled", s"-javaagent:${path}") Seq("-noverify", "-XX:+UseConcMarkSweepGC", "-XX:+CMSClassUnloadingEnabled", s"-javaagent:${path}")
} else {
// New JRebel agent
Seq(s"-agentpath:${path}")
}
} }
// Exclude a war file from published artifacts // Exclude a war file from published artifacts

View File

@@ -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. Fortunately, the gitbucket project is already set up to use JRebel.
You only need to tell jvm where to find the jrebel jar. 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 ```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: 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.
```bash
export JREBEL=~/jrebel/legacy/jrebel.jar
```
Now reload your shell: Now reload your shell: