java - 如何在 Eclipse 本身中运行 Spring Boot Web 应用程序?

标签 java spring eclipse spring-boot

我能够在我的 Eclipse (STS) 中运行几个示例应用程序。 现在,我想在 Eclipse 中运行一个 Web 应用程序。

我尝试使用 link 中给出的示例应用程序“spring-boot-sample-web-jsp” 我能够将其 war 导出到外部 tomcat 并运行应用程序。 现在我的问题是如何在 eclipse 中运行 Spring Boot Web 应用程序?

最佳答案

这个答案很晚,但我遇到了同样的问题。我发现了一些有用的东西。
在eclipse Project Explorer中,右键项目名称->选择“Run As”->“Maven Build...”
在目标中,输入 spring-boot:run 然后点击运行按钮。

我有 STS 插件(即 SpringSource Tool Suite),所以在某些项目中,我会在 Run As 下获得“Spring Boot App”选项。但是,由于某种原因,它并不总是出现。我使用上述解决方法。
这是解释如何运行 Spring Boot 应用程序的引用:
Spring boot tutorial

关于java - 如何在 Eclipse 本身中运行 Spring Boot Web 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23677808/

相关文章:

eclipse - 项目没有出现在 Eclipse Project Explorer 中,并且我无法导入它

java - Android,Java - AutocompleteTextView列表显示在编辑框下

java - 类加载问题

Java环境变量设置

java - In() 使用 spring jdbc?

java.lang.IllegalArgumentException : Unsupported class file major version 58

java - 为什么不用导入就可以使用Predicate参数?

Java欧元符号转换为货币符号

java - 使用 BeanUtils 或类似工具将非空属性从一个对象复制到另一个对象

java - 如何在 Java 中重置计时器?