1、如果Eclipse安装了Eclipse-STS插件,Eclipse-STS(Spring Source Tool)插件,那么可以直接使用该插件运行Springboot项目,直接右击main方法,找到运行即可,如下所示:

2、如果Eclipse软件工具中没有安装STS开发插件,也可以通过Maven的方式运行。直接输入spring-boot:run,就可以启动SpringBoot项目了,如下所示:

在Goals里面输入spring-boot:run,然后勾选Skip Tests即可,然后点击Apply,最后点击Run运行即可:

使用Maven的maven build来运行,控制台打印日志,如下所示:

  1 [INFO] Scanning for projects...2 [INFO] 3 [INFO] -----------------------< com.bie:springboot-01 >------------------------4 [INFO] Building springboot-01 0.0.1-SNAPSHOT5 [INFO] --------------------------------[ jar ]---------------------------------6 [INFO] 7 [INFO] >>> spring-boot-maven-plugin:2.3.4.RELEASE:run (default-cli) > test-compile @ springboot-01 >>>8 [INFO] 9 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ springboot-01 ---10 [INFO] Using 'UTF-8' encoding to copy filtered resources.11 [INFO] Copying 1 resource12 [INFO] Copying 0 resource13 [INFO] 14 [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ springboot-01 ---15 [INFO] Changes detected - recompiling the module!16 [INFO] Compiling 2 source files to E:\eclipse\eclipse\workspace_springboot\springboot-01\target\classes17 [INFO] 18 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ springboot-01 ---19 [INFO] Not copying test resources20 [INFO] 21 [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ springboot-01 ---22 [INFO] Not compiling test sources23 [INFO] 24 [INFO] <<< spring-boot-maven-plugin:2.3.4.RELEASE:run (default-cli) < test-compile @ springboot-01 <<<25 [INFO] 26 [INFO] 27 [INFO] --- spring-boot-maven-plugin:2.3.4.RELEASE:run (default-cli) @ springboot-01 ---28 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-buildpack-platform/2.3.4.RELEASE/spring-boot-buildpack-platform-2.3.4.RELEASE.pom29 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-buildpack-platform/2.3.4.RELEASE/spring-boot-buildpack-platform-2.3.4.RELEASE.pom (3.1 kB at 4.4 kB/s)30 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/net/java/dev/jna/jna-platform/5.5.0/jna-platform-5.5.0.pom31 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/net/java/dev/jna/jna-platform/5.5.0/jna-platform-5.5.0.pom (1.8 kB at 14 kB/s)32 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/net/java/dev/jna/jna/5.5.0/jna-5.5.0.pom33 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/net/java/dev/jna/jna/5.5.0/jna-5.5.0.pom (1.6 kB at 11 kB/s)34 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.pom35 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.pom (6.6 kB at 31 kB/s)36 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpcomponents-client/4.5.12/httpcomponents-client-4.5.12.pom37 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpcomponents-client/4.5.12/httpcomponents-client-4.5.12.pom (16 kB at 120 kB/s)38 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.pom39 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.pom (5.0 kB at 21 kB/s)40 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpcomponents-core/4.4.13/httpcomponents-core-4.4.13.pom41 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpcomponents-core/4.4.13/httpcomponents-core-4.4.13.pom (13 kB at 52 kB/s)42 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-loader-tools/2.3.4.RELEASE/spring-boot-loader-tools-2.3.4.RELEASE.pom43 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-loader-tools/2.3.4.RELEASE/spring-boot-loader-tools-2.3.4.RELEASE.pom (2.3 kB at 21 kB/s)44 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.6.3/maven-plugin-api-3.6.3.pom45 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.6.3/maven-plugin-api-3.6.3.pom (3.0 kB at 13 kB/s)46 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/3.6.3/maven-3.6.3.pom47 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/3.6.3/maven-3.6.3.pom (26 kB at 177 kB/s)48 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.6.3/maven-model-3.6.3.pom49 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.6.3/maven-model-3.6.3.pom (4.1 kB at 17 kB/s)50 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.pom51 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.pom (5.3 kB at 39 kB/s)52 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.6.3/maven-artifact-3.6.3.pom53 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.6.3/maven-artifact-3.6.3.pom (2.4 kB at 9.2 kB/s)54 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.pom55 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.pom (28 kB at 208 kB/s)56 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.4/org.eclipse.sisu.plexus-0.3.4.pom57 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.4/org.eclipse.sisu.plexus-0.3.4.pom (4.2 kB at 20 kB/s)58 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/sisu-plexus/0.3.4/sisu-plexus-0.3.4.pom59 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/sisu-plexus/0.3.4/sisu-plexus-0.3.4.pom (14 kB at 106 kB/s)60 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.4/org.eclipse.sisu.inject-0.3.4.pom61 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.4/org.eclipse.sisu.inject-0.3.4.pom (2.6 kB at 11 kB/s)62 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/sisu-inject/0.3.4/sisu-inject-0.3.4.pom63 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/sisu-inject/0.3.4/sisu-inject-0.3.4.pom (14 kB at 124 kB/s)64 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0.pom65 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0.pom (7.9 kB at 34 kB/s)66 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-buildpack-platform/2.3.4.RELEASE/spring-boot-buildpack-platform-2.3.4.RELEASE.jar67 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar68 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar69 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/net/java/dev/jna/jna/5.5.0/jna-5.5.0.jar70 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/net/java/dev/jna/jna-platform/5.5.0/jna-platform-5.5.0.jar71 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-buildpack-platform/2.3.4.RELEASE/spring-boot-buildpack-platform-2.3.4.RELEASE.jar (183 kB at 731 kB/s)72 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-loader-tools/2.3.4.RELEASE/spring-boot-loader-tools-2.3.4.RELEASE.jar73 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar (329 kB at 538 kB/s)74 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.6.3/maven-plugin-api-3.6.3.jar75 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.6.3/maven-plugin-api-3.6.3.jar (47 kB at 49 kB/s)76 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.4/org.eclipse.sisu.plexus-0.3.4.jar77 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-loader-tools/2.3.4.RELEASE/spring-boot-loader-tools-2.3.4.RELEASE.jar (242 kB at 161 kB/s)78 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar79 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar (45 kB at 25 kB/s)80 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.4/org.eclipse.sisu.inject-0.3.4.jar81 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.4/org.eclipse.sisu.plexus-0.3.4.jar (205 kB at 114 kB/s)82 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar83 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar (778 kB at 282 kB/s)84 [INFO] Downloading from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0.jar85 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar (262 kB at 90 kB/s)86 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.4/org.eclipse.sisu.inject-0.3.4.jar (379 kB at 121 kB/s)87 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0.jar (53 kB at 17 kB/s)88 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/net/java/dev/jna/jna/5.5.0/jna-5.5.0.jar (1.5 MB at 401 kB/s)89 [INFO] Downloaded from nexus-aliyun: http://maven.aliyun.com/nexus/content/groups/public/net/java/dev/jna/jna-platform/5.5.0/jna-platform-5.5.0.jar (2.7 MB at 586 kB/s)90 [INFO] Attaching agents: []91 92   .   ____          _            __ _ _93  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \94 ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \95  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )96   '  |____| .__|_| |_|_| |_\__, | / / / /97  =========|_|==============|___/=/_/_/_/98  :: Spring Boot ::        (v2.3.4.RELEASE)99
100 2020-10-24 11:53:18.219  INFO 10196 --- [           main] com.bie.Springboot01Application          : Starting Springboot01Application on DESKTOP-V37QSSE with PID 10196 (E:\eclipse\eclipse\workspace_springboot\springboot-01\target\classes started by biehl in E:\eclipse\eclipse\workspace_springboot\springboot-01)
101 2020-10-24 11:53:18.221  INFO 10196 --- [           main] com.bie.Springboot01Application          : No active profile set, falling back to default profiles: default
102 2020-10-24 11:53:19.608  INFO 10196 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
103 2020-10-24 11:53:19.617  INFO 10196 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
104 2020-10-24 11:53:19.617  INFO 10196 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.38]
105 2020-10-24 11:53:19.666  INFO 10196 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
106 2020-10-24 11:53:19.667  INFO 10196 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1412 ms
107 2020-10-24 11:53:19.782  INFO 10196 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
108 2020-10-24 11:53:19.898  INFO 10196 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
109 2020-10-24 11:53:19.907  INFO 10196 --- [           main] com.bie.Springboot01Application          : Started Springboot01Application in 1.968 seconds (JVM running for 2.275)

注意:当使用Eclipse-STS建立了SpringBoot项目时,会在项目后面标记 [boot] 的提示信息。

SpringBoot自带Tomcat容器,所以项目启动后通过浏览器输入http://localhost:8080,就可以直接访问控制器返回的信息。最后加上自己的控制层请求路径即可访问到方法返回信息。

使用Maven来运行Springboot项目相关推荐

  1. IDEA如何运行SpringBoot项目(超详细截图)

    []:hello你好我是辰兮,很高兴你能来阅读,昵称是希望自己能不断精进,向着优秀程序员前行! 博客来源于项目以及编程中遇到的问题总结,偶尔会有读书分享,我会陆续更新Java前端.后台.数据库.项目案 ...

  2. VS Code运行SpringBoot项目

    介绍 Visual Studio Code 下载地址 https://code.visualstudio.com/ 前端开发工具,相比webstorm而言,要轻量不少,主要是还轻量免费 运行sprin ...

  3. Maven Wrapper 之 SpringBoot 项目下的 mvnw.cmd

    Maven Wrapper 之 SpringBoot 项目下的 mvnw.cmd Maven Wrapper 文件 安装 Maven Wrapper 用 Maven Wrapper 打包 切换 Mav ...

  4. 运行springboot项目时报错: Description: The bean ‘userServiceImpl‘ could not be injected as a

    运行springboot项目时报错:Description:The bean 'userServiceImpl' could not be injected as a 'com.tang.servic ...

  5. idea community社区版 运行springboot项目

    idea community社区版 运行springboot项目 今天我的idea旗舰版30天试用期到了,之前下载了一个社区版的,想用他打开调试一下项目. 直接导入项目后没有报错,但是运行之后没有反应 ...

  6. Linux 后台运行 springboot项目

    Linux 后台运行 springboot项目 命令如下: nohup java -jar lihaozhe.jar >/dev/null 2>&1 & nohup jav ...

  7. IDEA使用Jrebel运行SpringBoot项目

    IDEA 中配置 Jrebel 1.打开IDEA Preferences 界面,Compiler-> 勾选 Build project automatically. 2.按组合键 Shift+C ...

  8. linux 运行springboot 项目 (后台运行,并且打印实时日志)

    首先 利用 maven 将springboot 项目 打成 jar包 maven 打包插件: <build><plugins><plugin><groupId ...

  9. 使用Maven插件构建SpringBoot项目,生成Docker镜像push到DockerHub上

    一个用于构建和推送Docker镜像的Maven插件. 使用Maven插件构建Docker镜像,将Docker镜像push到DockerHub上,或者私有仓库,上一篇文章是手写Dockerfile,这篇 ...

最新文章

  1. GitHub标星3w+的项目,全面了解算法和数据结构知识
  2. CTFshow 命令执行 web41
  3. SAP ECC 6.0有哪些增强功能
  4. Redis基础系列-0x003:String
  5. BrowserSync开发利器
  6. java 每秒处理1000个请求_每秒处理请求数和并发是一个概念吗?
  7. java生成world文件_Hello World 项目创建与项目配置文件介绍
  8. No package ‘libmatekbd‘ found
  9. 吉他扒和弦 扒谱工具Riffstation
  10. 【概率论】极大似然估计和最大后验估计
  11. C#图片无损转换为ico格式
  12. 打印机显示脱机怎么办?
  13. 太阳能逐日自动跟踪系统实训装置QY-T28
  14. 从冬令营到字节跳动,我从ICPCer变身Bytedancer
  15. Cobbler 批量安装操作系统 (基于Centos7.x )
  16. 【数据分析与可视化】股票市场分析实战之历史趋势分析
  17. 以太网标准-802.3各个标准简介
  18. Matplotlib 常用可视化操作
  19. 饿了么联盟在哪里申请物料
  20. RealView编译器常用特有功能

热门文章

  1. 一键下载:将知乎专栏导出成电子书
  2. C语言 字符串”char 12346“ 写一段代码提取字符串的数字
  3. java实现蔬菜版的大富翁游戏~~~
  4. 新浪微博多处XSS漏洞
  5. 个人对23种设计模式总结 优缺点理解并分析
  6. 新建项目拷贝html报错,ESA2GJK1DH1K基础篇: 移植源码中SmartConfig程序到自己的项目...
  7. kubeadm安装生产环境多master节点高可用集群
  8. 开通微信支付,银行账户和主体名称不一致时,如果处理
  9. Random(三)反射的高效替代方案,Unsafe类
  10. AMZI! PROLOG白皮书