top of page
Search
Writer's pictureBojan Belic

Spring Boot — Hot Swapping a Gradle project in IntelliJ with Kotlin support

** This article has been ported over from my Medium blog. - Original time of writing: Dec 24, 2017 **

If you happen to be using IntelliJ as your IDE for a Spring Boot project with Gradle & Kotlin support, and you want to make use of the spring-boot-devtools, than there is a little bit of configuration that needs to happen:



1. Enable auto-make on save


Millions have explained this before me, follow this guide: https://stackoverflow.com/a/36827568



2. Add ‘spring-boot-devtools’ dependency & ‘idea’ plugin in your build.gradle file


Simply add this line next to the ‘apply plugin’ lines in your file:

apply plugin: 'idea'

And afterward add this to your dependencies:

compile('org.springframework.boot:spring-boot-devtools')


3. Redefine output dir location to match kotlin’s output dir


And this was the tricky part, add this block to your build.gradle:

idea {
   module {
      inheritOutputDirs = false
      outputDir = file("$buildDir/classes/kotlin/main")
   }
}


4. $ gradle bootRun


Now open up a terminal instance, and run the bootRun gradle task. Once you edit and save one of your files in IntelliJ, you should see the terminal detect the change and restart the application.


You will still have to refresh your browser window yourself, but this is already a big improvement.

868 views1 comment

Recent Posts

See All

1 Comment


divane9975
Nov 05, 2023

"Stap op de e-chopper: geniet van het stille en schone rijden" moedigt mensen aan om elektrische choppers te ervaren. Deze voertuigen bieden geluidsarme en milieuvriendelijke ritten. Het benadrukt het plezier van rustig rijden zonder geluidsoverlast en draagt bij aan een schonere omgeving.


Wat is een e-chopper?

Een E-chopper, ook wel elektrische chopper genoemd, is een elektrische scooter met een opvallend en stoer uiterlijk, geïnspireerd op de klassieke choppermotoren. In plaats van een verbrandingsmotor maakt een E-chopper gebruik van een elektrische motor die wordt aangedreven door een oplaadbare batterij. Deze elektrische aandrijving zorgt voor milieuvriendelijke en geluidsarme prestaties. e chopper huren E-choppers zijn populair voor stedelijke mobiliteit en recreatieve ritten, en ze bieden een combinatie van gemakkelijke bediening, duurzaamheid en een…


Like
bottom of page