title: Is it possible to have a "HotReload" docker based java environment?
body: <p>I am trying to have a java program that is built with maven to run on a docker-compose scenario and hot reload as I make changes.
  I added <a href="https://github.com/TravaOpenJDK/trava-jdk-11-dcevm" rel="nofollow noreferrer">trava-jdk</a> libvm on top of the original libvm and added the hotswapagent lib on the proper place. It gives me what I want when I run java -version</p>
  
  <pre class="lang-sh prettyprint-override"><code>Starting HotswapAgent '/usr/local/openjdk-11/lib/hotswap/hotswap-agent.jar'
  HOTSWAP AGENT: 10:18:24.771 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.4.0} - unlimited runtime class redefinition.
  HOTSWAP AGENT: 10:18:24.992 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [JdkPlugin, Hotswapper, WatchResources, ClassInitPlugin, AnonymousClassPatch, Hibernate, Hibernate3JPA, Hibernate3, Spring, Jersey1, Jersey2, Jetty, Tomcat, ZK, Logback, Log4j2, MyFaces, Mojarra, Omnifaces, ELResolver, WildFlyELResolver, OsgiEquinox, Owb, Proxy, WebObjects, Weld, JBossModules, ResteasyRegistry, Deltaspike, GlassFish, Vaadin, Wicket, CxfJAXRS, FreeMarker, Undertow, MyBatis]
  openjdk version "11.0.5" 2019-10-15
  OpenJDK Runtime Environment 18.9 (build 11.0.5+10)
  Dynamic Code Evolution 64-Bit Server VM 18.9 (build 11.0.5+5-202001261315, mixed mode)
  </code></pre>
  
  <p>My dockerfile to achieve that is the one below</p>
  
  <pre><code>FROM maven:latest
  
  WORKDIR /tmp
  RUN wget https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases/download/dcevm-11.0.5%2B5/java11-openjdk-dcevm-linux.tar.gz
  RUN tar -xvf  java11-openjdk-dcevm-linux.tar.gz
  RUN mv dcevm-11.0.5+5 /dcevm
  WORKDIR /dcevm
  RUN rm /usr/local/openjdk-11/lib/server/libjvm.so
  RUN cp /dcevm/lib/server/libjvm.so /usr/local/openjdk-11/lib/server/
  RUN cp -r /dcevm/lib/hotswap /usr/local/openjdk-11/lib/
  </code></pre>
  
  <p>Now I find myself a little lost on how to apply the hot reload on the Ide and properly run the code.</p>
  
  <p>In case you are wondering why I need such a hack I have an IoT environment that has E2E tests and I wanted to be able to quickly iterate on new tests or failing tests without needing to recompile or restart containers.</p>