After some help from @rwinch, we've been able to drop this configuration into our build.gradle, make a change, compile from either our browser or the command line, and see the change made in the application without a restart.
// build.gradle
apply plugin: 'idea'
idea {
module {
inheritOutputDirs = false
outputDir = file("$buildDir/classes/main/")
}
}
Note:
- Intellij must be configured to use the same Java version as the command line gradle task.
- Enable "Make Project Automatically", Intellij will compile your changes after save and they will be available
- Spring Loaded must be a buildscript dependency
Here's an example project:
berlin-ab/cats@c9ce250
it's on the feature/autoreload branch.
the full build.gradle
// build.gradle
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'spring-boot'
idea {
module {
inheritOutputDirs = false
outputDir = file("$buildDir/classes/main/")
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.0.2.RELEASE"
classpath 'org.springframework:springloaded:1.2.0.RELEASE'
}
}
After some help from @rwinch, we've been able to drop this configuration into our build.gradle, make a change, compile from either our browser or the command line, and see the change made in the application without a restart.
Note:
Here's an example project:
berlin-ab/cats@c9ce250
it's on the
feature/autoreloadbranch.the full
build.gradle