栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringCloud微服务实战——搭建企业级开发框架(四):集成SpringCloud+SpringBoot

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringCloud微服务实战——搭建企业级开发框架(四):集成SpringCloud+SpringBoot

1、在GitEgg工程的根目录,最上级父pom.xml文件中引入需要依赖的库及Maven插件,设置编码方式:



    4.0.0

    com.gitegg.cloud
    GitEgg-Cloud
    gitegg-cloud
    pom
    1.0-SNAPSHOT

    
        gitegg-common
        gitegg-oauth
        gitegg-gateway
        gitegg-plugin
        gitegg-service
        gitegg-service-api
    

    
        
        1.8
        
        3.8.1
        
        UTF-8
        
        UTF-8
        
        UTF-8

        
        1.0-SNAPSHOT
        
        2.3.3.RELEASE
        
        Hoxton.SR8
    

    
        
        
            org.projectlombok
            lombok
        
    

    
        
            
            
                org.springframework.boot
                spring-boot-dependencies
                ${spring.boot.version}
                pom
                import
            
            
            
                org.springframework.cloud
                spring-cloud-dependencies
                ${spring.cloud.version}
                pom
                import
            
        
    

    
        ${project.name}
        
            
                src/main/resources
            
            
                src/main/java
                
                    **
@SpringBootApplication
public class GitEggSystemApplication {

    public static void main(String[] args) {
        SpringApplication.run(GitEggSystemApplication.class,args);
    }

}

4、在gitegg-service-system工程的resources目录下新建application.yml文件:

server:
  port: 8001
spring:
  application:
    name: gitegg-service-system

5、在GitEggSystemApplication类上右键,Run ‘GitEggSystemApplicat…’ ,运行项目,可以看到最基础的SpringBoot项目启动成功:

本文源码在https://gitee.com/wmz1930/GitEgg 的chapter-04分支。

GitEgg-Cloud是一款基于SpringCloud整合搭建的企业级微服务应用开发框架,开源项目地址:

Gitee: https://gitee.com/wmz1930/GitEgg
GitHub: https://github.com/wmz1930/GitEgg

欢迎感兴趣的小伙伴Star支持一下。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/341035.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号