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

JRebel does not listen or reload changes to the src / main / resources directory so that reading such files will return a cached and invalid value.

This is normal?

+3


source to share


4 answers


I had the same problem and after reading the manual I found a solution that works for me.

I am using a JSF project with Spring 3, with netbeans and running jrebel through the IDE

Please note that the comments were the things I tried earlier, that doesn't mean it won't work.

The important thing here is adding the resource path to the classpath and removing the link tag that jrebel automatically places in 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 pom.xml by setting addResourcesDirToRebelXml property 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

+1


source


Make sure the directory is listed in the rebel.xml configuration file that is deployed with the application. If your rebel.xml was generated using the JRebel plugin for Maven , just make sure you specify that you want the resource directory to be included in the config

<addResourcesDirToRebelXml>true</addResourcesDirToRebelXml>  

      



If you're using IntelliJ IDEA and don't see the changes being applied to resources, then you probably haven't configured the IDE to copy files from the resource directory to the target directory. Or mark the resource directory as resource directory (right click on the folder in the project tree -> Mark directory as ...)

+5


source


If you are using IntelliJ IDEA, try Make Project from the Build tab or by pressing Ctrl + F9.

+1


source


Make sure your project has no compilation error in eclipse.

Also check JDK compliance. I had the wrong version and my target / class files were not updating.

If the content of target / classes is not updated, jrebel does not see any changes.

+1


source







All Articles