jrebel

JRebel not listening or reloading changes in src/main/resources directory


JRebel not listening or reloading changes in src/main/resources directory making reading such files return cached and invalid value.

Is this normal?


Solution

  • I've had the same issue, and reading the manual i found a solution that works for me.

    I'm using a JSF project with Spring 3, with netbeans and running jrebel via IDE

    Notice that the comments were things that i have tried previously, it doesn't means that won't work.

    The important thing here is the addition of resource path into classpath and the elimination of the link tag that jrebel puts automatically into the web node.

    rebel.xml:

    <application generated-by="netbeans"
        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_project_root/target/classes"></dir>-->
        <dirset dir="/path_to_project_root/">
            <include name="**/target/classes"/>
            <include name="**/src/main/resources"/>
        </dirset> 
        </classpath>
    
        <web>
        <!--<link target="/">-->
            <dir name="/path_to_project_root/src/main/webapp"></dir> 
            <dir name="/path_to_project_root/src/main/resources"></dir> 
        <!--</link>-->
        </web>
    
    </application>
    

    Also i configured the plugin in the pom.xml, setting the property addResourcesDirToRebelXml to true

    pom.xml:

    <plugin>
        <groupId>org.zeroturnaround</groupId>
        <artifactId>jrebel-maven-plugin</artifactId>
        <version>1.1.7</version>
        <configuration>
            <addResourcesDirToRebelXml>true</addResourcesDirToRebelXml>
        </configuration>
        <executions>
            <execution>
                <id>generate-rebel-xml</id>
                <phase>process-resources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
            </execution>
        </executions>               
    </plugin> 
    

    source: https://manuals.zeroturnaround.com/jrebel/standalone/advanced-config.html