Search code examples
classloaderwildflyjprofilerjrebel

Controlling JRebel package scope


I am trying to speed up execution of code being debugged with JRebel. In particular, I notice that framework code is slow. I am wondering whether I can tell JRebel to ignore certain packages, in much the same way that we can setup JProfiler to ignore certain packages and patterns.


Solution

  • You most definitely can.

    • Use a system property (or add to jrebel.properties) meant just for that purpose. More information at JRebel agent properties.

      -Drebel.exclude_packages=PACKAGE1,PACKAGE2,...
      
    • Specify the excluded packages in rebel.xml using Ant-styled patterns. More information at rebel.xml configuration.

      <?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="/path/to/module/build/directory/root">
            <exclude name="com/yourapp/package1/internal/**"/>
          </dir>
        </classpath>
      </application>
      

    Both ways work similarly but since the second one enables to customize each module inividually it is generally preferred.