eclipse环境配置_快速搭建SpringBoot开发应用环境

相信很多人开发web程序的时候用过ssm或者是ssh等一些框架,这些传统的开发方式会有大量的XML配置文件存在项目当中,整合第三方框架繁琐的配置会导致开发效率的降低。

Springboot通过前期很少的配置以及嵌入式的应用服务器可以很快速的启动你的服务,无论你用的开发工具是eclipse还是idea,spring还提供了快速搭建应用的插件

springboot相比传统的开发方式的优点:

1:简化了配置

2:简化了编码

3:简化了部署

我用的开发工具是eclipse,一直听说idea怎么怎么好用,但是由于我对于eclipse长期的感情导致我一直没有更换(就是懒啊),所以说一下通过eclipse安装springsource-tool-suite(sts插件)快速创建一个springboot应用。(idea也有插件可以直接创建springboot服务,可以查看官网资料)

eclipse安装sts插件分为在线安装和离线安装,在线太慢推荐离线安装

1)安装maven环境,参考下面这个文章:

eclipse安装maven环境 叮当LIU,公众号:PLMCODEmyEclipse或eclipse搭建Maven环境

2)下载sts离线安装包

      因为我的eclipse版本是4.10.0所以下载的sts离线压缩包的版本是3.9.7,文件名称(springsource-tool-suite-3.9.7.RELEASE-e4.10.0-updatesite.zip),在官网:http://spring.io/tools/sts/all 找到eclipse对应的sts离线安装包。百度也行...

3)下载完之后在eclipse中进行安装

点击Eclipse中Help==>Install New Software...菜单,进入Available Software

c8bfb03a4d9e30bb9ce1251245e9f78e.png

200a5f83f9073669b711fadb65ecfa99.png

5d4ad67cdce15d1f6a4614603dcfb21b.png

等待一段时间安装完成之后在eclipse的创建项目页面总查看是否有SpringBoot选项,有则说明安装成功

5020430650c58c0237d04b4cdb8a3c2f.png

4)在eclipse中创建SpringBoot项目

选择new Spring Starter Project,创建springboot项目

b0b08e28fc444b127eeae5fac48e2527.png

创建完之后如果pom.xml文件中的标签报错提示:

Project build error: Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE from/to mirrorId (http://central.maven.org/maven2/): central.maven.org an

解决办法:

1:先清空maven仓库中的内容

2:在maven的conf文件夹中的settings.xml文件中的mirrors标签中加入下面内容

                   repo2           central           spring2.0 for this Mirror.           https://repo.spring.io/libs-milestone                                net-cn            central            Human Readable Name for this Mirror.            http://maven.net.cn/content/groups/public/                                 ui            central            Human Readable Name for this Mirror.            http://uk.maven.org/maven2/                                ibiblio            central            Human Readable Name for this Mirror.           http://mirrors.ibiblio.org/pub/mirrors/maven2/                                jboss-public-repository-group            central            JBoss Public Repository Group            http://repository.jboss.org/nexus/content/groups/public            

3:在项目中右键选择maven==》update project ,选中Force Update of Snap...选项,等待一段时间(需要下载相关文件)

创建完成后的demo项目如下:选择Run As==>Spring Boot App运行出现下面控制台内容表示项目搭建成功

a09b8ca308f30ef3d4473176345ff0a6.png


PS:欢迎关注我的技术个人公众号:PLMCODE,记录个人学习道路上会遇到的知识点(RCP开发,SOA开发,ITK开发,AWC开发,WEB开发),希望我们可以相互学习,微信号:LyleMack。

2be7ac2cce1b9e33d20adca3929e6f5a.png

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值