javaspringnetbeansspring-bootspring-web

org.springframework.boot.SpringApplication can not be resolved


I am trying to Run a web-service server as standalone application using the spring-boot (1.2.4.RELEASE). I have refereed the tutorial provided here spring site.

But in my application I am unable to locate org.springframework.boot.SpringApplication class in any of the APIs of spring boot.

Below is pom.xml file I am using for this:

<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>

Can anyone help me to find out what could be wrong in this.


Solution

  • I got this working. After using the mvn clean install it has started working.

    Initial it was not showing the spring-boot-1.2.5.RELEASE.jar(to which SpringApplication class belong) in the project dependencies. After running above command this dependency got added and now its working fine.