2

From the JRebel documentation

The rebel.xml configuration file has to be added to the deployed WAR or JAR archive. This will let the JRebel agent know which workspace paths to monitor for class and resource updates.

https://manuals.zeroturnaround.com/jrebel/standalone/maven.html

In my war configuration in pom.xml I am explicitly removing the JRebel configuration from my war because to my understanding it serves no purpose when deployed on a server and contains workstation specific information I would rather not have visible in a war.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.2.0</version>
    <configuration>
        <failOnMissingWebXml>false</failOnMissingWebXml>
        <packagingExcludes>
            <!-- Exclude JRebel configuration from the war. -->
            WEB-INF/classes/rebel.xml
        </packagingExcludes>
    </configuration>
</plugin>

JRebel still works fine when I run locally as a Spring Boot application, and of course my war works fine on the server without the rebel.xml. Why does the documentation say it needs to be included in the war?

secondbreakfast
  • 4,194
  • 5
  • 47
  • 101

1 Answers1

3

The rebel.xml file works like eyes for JRebel pointing it to your compiled classes and resources for reloading. In case of exploded mode it is usually not needed, but for packaged WARs and JARs it is. If you have this file locally and by deployment you mean deploying to a production server, then indeed it's good to remove this file from the deployed WAR as JRebel is only meant to be a tool for development stage.

Ptah
  • 46
  • 2