Gradle Spring Boot

class file for javax.servlet.ServletException not found

投稿日:

Gradle 4.0.1, Spring Boot 2.0.0.BUILD-SNAPSHOT にて。

error: cannot access ServletException
public class Application extends SpringBootServletInitializer {
       ^
  class file for javax.servlet.ServletException not found
1 error
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

build.gradle の dependencies に追加。

dependencies {
    ...
    compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
    ...
}

-Gradle, Spring Boot

Copyright© hirooka.pro , 2013-2018 All Rights Reserved.