Spring Boot application can't resolve the org.springframework.boot package

前端 未结 17 1821
半阙折子戏
半阙折子戏 2020-12-29 19:34

I have set up a spring boot project using the Spring Initializer, I tried several times to create a new project or play with the dependencies, everything seems to be in plac

相关标签:
17条回答
  • 2020-12-29 20:03

    Maybe there is a problem with the JAR files in the local Maven repository. Try deleting the .m2/repository folder and hit Maven -> Update Project... another time to trigger Maven to download the dependencies again. I tried it and it worked for me.

    0 讨论(0)
  • 2020-12-29 20:06

    I have this problem when using STS. After edited something, I see that, some workspaces when create a project will happen this problem, and others will not. So I just create a new project in workspaces will not happen.

    0 讨论(0)
  • 2020-12-29 20:07

    This answer may be out of topic for most of readers. In my case the dependency didn't update and "mvn clean" didn't work since my wifi network at the office is highly securised, leaving a "connection timed out". (same respect github pushes and pulls don't work) I just moved to teathering with my phone and it works. Stupid, out of topic for most, but it may help some very specific cases.

    0 讨论(0)
  • 2020-12-29 20:14

    I had the same problem when I was trying to work with a basic spring boot app. I tried to use the latest spring-boot version from the official spring-boot site.

    As on today, the latest version is 1.5.4.RELEASE. But I keep getting compilation issues on my eclipse IDE irrespective of multiple cleanups to the project. I lowered the version of spring-boot to 1.5.3.RELEASE and it simply worked !! Some of my earlier projects were using the old version which drove me to try this option.

    0 讨论(0)
  • 2020-12-29 20:15

    Mine worked by adding

    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-autoconfigure</artifactId>
        <version>2.1.3.RELEASE</version>
    </dependency>
    

    instead of directly using other main dependencies, I have no idea why.

    0 讨论(0)
  • 2020-12-29 20:16

    Right button on project -> Maven -> Update Project

    then check "Force update of Snapshots/Releases"

    0 讨论(0)
提交回复
热议问题