title: Gradle project error - java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
body: <p>This is my main application code:</p>
  
  <pre><code>package u.d.dip.rs.app;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
  
  @EnableWebSecurity
  @SpringBootApplication
  @ComponentScan(basePackages = "u.d.dip")
  @EnableAutoConfiguration
  public class DipApplication {
      public static void main(String[] args) {
          SpringApplication.run(DipApplication.class, args);
      }
  }
  </code></pre>
  
  <p>I'm using gradle to build the project. Even though SpringApplication file is properly imported I'm getting the following error:</p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 6 more
  
  Process finished with exit code 1
  </code></pre>
  
  <p>I'm getting following gradle message when I hover over SpringApplication</p>
  
  <pre><code>[Gradle: org.springframework.boot:spring-boot:1.5.1.RELEASE] org.springframework.boot public class SpringApplication extends Object
  </code></pre>
  
  <p>Any help would be much appreciated.
  Thanks in advance!</p>