我正在尝试使用 spring-boot (1.2.4.RELEASE) 将 Web 服务服务器作为独立应用程序运行。我已经引用了提供的教程 here Spring 网站。
但是在我的应用程序中,我无法在 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>
任何人都可以帮助我找出其中可能存在的问题。
最佳答案
我得到了这个工作。使用 mvn clean install 后,它开始工作了。
最初它没有在项目依赖项中显示 spring-boot-1.2.5.RELEASE.jar(SpringApplication 类所属)。运行上述命令后,此依赖项已添加,现在可以正常工作。
关于java - org.springframework.boot.SpringApplication无法解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31179109/