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

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

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支持一下。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4673775.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-06
下一篇 2022-11-06

发表评论

登录后才能评论

评论列表(0条)

保存