Home Ask Login Register

Developers Planet

Your answer is one click away!

Taras Kohut February 2016

Intellij + Gradle + SpringLoaded + Tomcat

I'm developing Spring rest service using Gradle, Intellij, and Tomcat. I want to reload my changes without redeploying, so I use SpringLoaded. But it doesn't reload my project. Even hot swap doesn't work. Here is my build.gradle:

def group = 'com.expecker'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
sourceCompatibility = 1.8
targetCompatibility = 1.8
def springVersion = '4.0.0.RELEASE'
def hibernateVersion = '5.0.7.Final'
def junitVersion = '4.11'
repositories {
    mavenCentral()
}
dependencies {
    testCompile group: 'junit', name: 'junit', version: junitVersion
    compile "org.springframework:spring-core:$springVersion"
    compile "org.springframework:spring-web:$springVersion"
    compile "org.springframework:spring-webmvc:$springVersion"
    compile "org.springframework:spring-orm:$springVersion"
    compile "org.springframework:spring-jdbc:$springVersion"
    compile "org.springframework:spring-tx:$springVersion"
    compile "org.springframework:spring-orm:$springVersion"
    compile "org.springframework:spring-context:$springVersion"
    compile 'javax.servlet:javax.servlet-api:3.1.0'
    compile 'jstl:jstl:1.2'
    compile 'javax.servlet.jsp:jsp-api:2.2'
//  compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13' it seems like this library isn't compatible with spring 4.1.x
    compile 'com.fasterxml.jackson.core:jackson-databind:2.6.4'
    compile "org.hibernate:hibernate-core:$hibernateVersion"
    compile "org.hibernate:hibernate-entitymanager:$hibernateVersion"
    compile 'commons-dbcp:commons-dbcp:1.4'
    //compile('org.springframework:springloaded:1.2.5.RELEASE')
}
buildscript {
    repositories { jcenter() }
    dependencies {
        classpath 'org.springframework:springloaded:1.2.5.RELEASE'
    }
}
apply plugin: 'idea'
idea {
    module {
        inheritOutputDirs = false
        outputDir = file("$buildDir/classes/main/")
    }
}
/*
When built in OpenShift the 'openshift' profile wi        

Answers


Taras Kohut February 2016

My fault, spring loaded doesn't support adding of new classes. So, actually, everything works as expected.

Post Status

Asked in February 2016
Viewed 3,125 times
Voted 11
Answered 1 times

Search




Leave an answer


Quote of the day: live life