I have the following project structure
project-root
--core
---build.gradle
---project.gradle
--web
---build.gradle
---project.gradle
I configured jRebel to run with gradle, so I can start my embedded tomcat 8 with the command gradle tomcatRun
This shows log-output of jrebel and my application starts on the embedded server, but there is no hot deployment when i change java files.
With the IntelliJ JRebel Plugin I created the rebel.xml files for each of the project project-root, core and web. Also I added a rebel.xml inside the web project in the folder web/build/classes/main as described here
Normally jrebel should show at startup that its wachting some folders, but this is not the case on my site, so i guess there is something wrong with my configuration
here the rebel.xml files
project-root (Path c:/project-root/rebel.xml)
<?xml xsd....">
<classpath>
<dir name="c:/project-root/out/production/classes">
</dir>
</classpath>
</application>
core (Path c:/project-root/core/src/main/resources/rebel.xml)
<?xml version="1.0" encoding="UTF-8"?>
<application generated-by="intellij" 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="c:/project-root/core/out/production/resources">
</dir>
<dir name="c:/project-root/core/out/production/classes">
</dir>
</classpath>
</application>
web (Path c:/project-root/web/src/main/resources/rebel.xml)
<?xml version="1.0" encoding="UTF-8"?>
<application generated-by="intellij" 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="c:/project-root/web/out/production/classes">
</dir>
</classpath>
</application>
web (Path c:/project-root/web/build/classes/main/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://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
<dir name="c:/project-root/web/build/classes/main">
</dir>
</classpath>
<web>
<link target="/">
<dir name="c:/project-root/web/src/main/webapp">
</dir>
</link>
</web>
</application>
To attach jrebel to my gradle i did the following batch calls before starting gradle tomcatRun
set REBEL_HOME=C:\Users\myuser\.IdeaIC2017.3\config\plugins\jr-ide-idea\lib\jrebel6
set JAVA_OPTS="-agentpath:%REBEL_HOME%\lib\jrebel64.dll"
then calling gradlew tomcatRun starts the tomcat and jrebel
gradlew tomcatRun
2018-01-09 10:24:09 JRebel: Starting logging to file: C:\Users\myuser\.jrebel\jrebel.log
2018-01-09 10:24:09 JRebel:
2018-01-09 10:24:09 JRebel: #############################################################
2018-01-09 10:24:09 JRebel:
2018-01-09 10:24:09 JRebel: JRebel Agent 7.1.3 (201711301108)
2018-01-09 10:24:09 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu.
2018-01-09 10:24:09 JRebel:
2018-01-09 10:24:09 JRebel: Over the last 2 days JRebel prevented
2018-01-09 10:24:09 JRebel: at least 0 redeploys/restarts saving you about 0 hours.
But when I change some source files, nothing is detected by jrebel, also when i manually called gradlew compileJava