zoukankan      html  css  js  c++  java
  • Springcloud学习笔记25--JeecgBoot 启动jeecg-demo服务(升级某个模块为微服务模块)

    升级某个模块为微服务模块, 这里以demo为例

    1.添加微服务启动依赖

    修改pom,引入jeecg-boot-starter-cloud依赖

    <!-- 引入jeecg-boot-starter-cloud依赖 -->
    <dependency>
        <groupId>org.jeecgframework.boot</groupId>
        <artifactId>jeecg-boot-starter-cloud</artifactId>
    </dependency>

    加入打包插件

    <plugins>
       <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
       </plugin>
    </plugins>

     2.添加配置文件application.yml(可以忽略)

    如果没有则新建,内容如下:

    server:
      port: 7002
    spring:
      application:
        name: jeecg-demo

    3.在org.jeecg包下新建启动类(如果没有)

    package org.jeecg;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.cloud.openfeign.EnableFeignClients;
    
    @SpringBootApplication
    @EnableFeignClients
    public class JeecgDemoApplication {
        public static void main(String[] args)  {
            SpringApplication.run(JeecgDemoApplication.class, args);
        }
    }

    上述步骤完成 即可启动 demo 微服务模块,前提得把nacos配置成功。

     注意:需要在jeecg-cloud-gateway添加路由

     

  • 相关阅读:
    python安装cnstd卡住
    _、__、__xx__之间的差别
    Celery模块使用
    同一主机,开启多个不同端口的redis进程
    php配置变更记录
    Linux安装Nodejs
    ElasticSearch中term和match探索
    Centos安装elasticsearch,php连接使用
    centos8自定义目录安装php7.3
    centos8自定义目录安装nginx
  • 原文地址:https://www.cnblogs.com/luckyplj/p/15357392.html
Copyright © 2011-2022 走看看