The type org.springframework.context.ConfigurableApplicationContext cannot be resolved

Your maven cache is corrupted. To resolve this problem, follow the steps below:

  • Go to the directory of your project on the command line.
  • Make sure your POM.xml is in the same directory as your command line
  • Run the command

    mvn dependency:purge-local-repository
    
  • If you receive build successful message, means the error has been resolved.

  • If error is still there, delete your (~/.m2/repository/org/springframework) folder and run

    mvn package
    

It will work properly now.