I\'m changing build systems from maven to gradle for a spring boot project. I get this stacktrace
19:03:08: Executing external task \'bootRun\'...
/home/dac/proj
It's probably an import issue in your source code - your Gradle build script uses Spring Boot 1.3.6.RELEASE in which SpringBootServletInitializer has the following fully qualified name:
org.springframework.boot.context.web.SpringBootServletInitializer
Your Maven pom.xml, however, uses Spring Boot 1.4.0.BUILD-SNAPSHOT, in which the package name was changed to:
org.springframework.boot.web.support.SpringBootServletInitializer
So if you go to your SampleJettyJspApplication and change the import to
import org.springframework.boot.context.web.SpringBootServletInitializer;
everything should be fine.
Alternatively, you could alter your Gradle build script to import 1.4.0.BUILD-SNAPSHOT, but that would require adding Spring's snapshot repository:
buildscript {
repositories {
maven.url "http://repo.spring.io/snapshot"
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT")
}
}
org.springframework.boot.web.support.SpringBootServletInitializer
is deprecated.
use below instead:
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
You should use the same spring boot version 1.4.0.BUILD-SNAPSHOT as in maven. org.springframework.boot.web.support.SpringBootServletInitializer
was introduced since 1.4.0 that's why gradle cannot find it.
You are using org.springframework.boot.context.web.SpringBootServletInitializer
this is deprecated. Instead:
org.springframework.boot.web.support.SpringBootServletInitializer
org.springframework.boot.web.servlet.support.SpringBootServletInitializer