General IDE configuration


Project configuration with relative paths

JRebel IDE plugins support paths variables pointing to current project’s path in rebel.xml (JRebel for Eclipse supports it as of 2018.2.1, JRebel for IntelliJ as of 2018.2.4). This enables you to create rebel.xml configuration once for your project and commit it into the SCM repository, enabling all developers to share the same configuration (rebel.xml files containing absolute paths should never be committed, as absolute paths will vary from developer to developer).

To use this, replace all occurrences of your project root path with a variable like ${rebel.projectpath.myprojectid} in your rebel.xml, replacing myprojectid with a unique ID for your project. rebel.projectpath is a mandatory prefix to have the JRebel IDE plugin auto-expand these values.

Note

Project ID in the variable doesn’t have to match any real project id, name or directory. The only restriction is that it should be unique in your current workspace, otherwise it might be overridden by some other project’s path (the precedence is not defined).

All variables with prefix rebel.projectpath. in the rebel.xml file are resolved to current project’s root path and passed to the application server as JVM arguments, so that JRebel Agent can resolve them at runtime.

For example, if you have project mySampleProject located in C:\path\to\mySampleProject, you can have such configuration in rebel.xml:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd">

  <classpath>
    <dir name="${rebel.projectpath.myproject}\target\classes"/>
  </classpath>

</application>

As a result, -Drebel.projectpath.myproject=C:\path\to\mySampleProject will be passed automatically to the application server started from the IDE.

Note

Automatic expanding of rebel.projectpath.* variables for servers started from outside the IDE (e.g. with CLI scripts) is supported as of JRebel for Eclipse 2019.2.0 and JRebel for IntelliJ 2019.2.2. This feature is not supported for the NetBeans and JDeveloper plugins.


Warning

Deprecated path variables. Due to inconsistent behavior across IDEs, these old variable are not recommended. Specifically, you should refrain from using them if JRebel users in your team are using different IDEs.

  • ${rebel.workspace.path} – Refers to the workspace root folder. Only applicable when using Eclipse. Don’t use in cross-IDE teams.

  • ${rebel.project.path} – Refers to the project’s root folder. Only applicable when using remote server support and an IDE. Should not be used when running JRebel locally.