org.springframework.boot.SpringApplication无法解析

时间:2015-07-02 08:16:25

标签: java spring netbeans spring-boot spring-web

我正在尝试使用spring-boot(1.2.4.RELEASE)将Web服务服务器作为独立应用程序运行。我已经提供了here弹簧网站提供的教程。

但是在我的应用程序中,我无法在spring boot的任何API中找到org.springframework.boot.SpringApplication类。

下面是我正在使用的pom.xml文件:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.4.RELEASE</version>
</parent>
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

任何人都可以帮我找出可能出现的问题。

1 个答案:

答案 0 :(得分:2)

我得到了这个工作。使用 mvn clean install 后,它已开始工作。

初始它没有在项目依赖项中显示spring-boot-1.2.5.RELEASE.jar(SpringApplication类所属的)。运行上面的命令后,这个依赖项被添加,现在它正常工作。

相关问题