0

I develop a simple standalone application without any application server. Can IDEA do hotswap with resources (hotswap works with classes fine when I do rebuild). Also I use gradle as a build system, my application read static resources from "src/main/resources". I just want that when I do rebuild my application could download newer version of my resouce file without restart.

I use this code to read resources:

Thread.currentThread().getContextClassLoader().getResourceAsStream(name)
mystdeim
  • 4,802
  • 11
  • 49
  • 77

1 Answers1

0

Yes, IDEA hotswaps changes made to file. You have 2 options:

  • right click on resource and select "Compile '[resource name]'"
  • go to "Gradle" pane and run "Project > Tasks > build > assemble"

Both of them will pick up resource changes and make them available with no need to restart Debug session.

Alex Radzishevsky
  • 3,416
  • 2
  • 14
  • 25
  • Works only with classes. When I do build my resources change in "out/production/..", but inside my application old version of file – mystdeim Jan 14 '17 at 16:50
  • How do you start your application (Using IDEA Run/Debug). Or you are connecting to debug remotely? What kind of application is that (simple Java, Webapp, ..)? – Alex Radzishevsky Jan 15 '17 at 15:55