mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 04:56:02 +01:00
Add support for new JRebel agent
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user