其他分享
首页 > 其他分享> > Springcloud学习笔记26--JeecgBoot 新建一个微服务模块

Springcloud学习笔记26--JeecgBoot 新建一个微服务模块

作者:互联网

1.创建一个module

 

 

 创建完成后,项目结构为:

 2.创建文件目录、启动类

(1)在pom文件中添加依赖和打包插件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>jeecg-cloud-module</artifactId>
        <groupId>org.jeecgframework.boot</groupId>
        <version>2.4.6</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.jeecgframework.boot</groupId>
    <artifactId>jeecg-cloud-test</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.jeecgframework.boot</groupId>
            <artifactId>jeecg-boot-base-core</artifactId>
        </dependency>
        <!--引入微服务启动依赖 starter-->
        <dependency>
            <groupId>org.jeecgframework.boot</groupId>
            <artifactId>jeecg-boot-starter-cloud</artifactId>
        </dependency>

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

(2)添加配置文件application.yml

server:
  port: 7004
spring:
  application:
    name: jeecg-cloud-test

(3)添加启动类

package org.jeecg;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication(scanBasePackages = "org.jeecg")
@EnableFeignClients(basePackages = "org.jeecg")
public class JeecgCloudTestApplication {

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

启动JeecgCloudTestApplication类,可以看到项目启动成功。

 

 

参考文献:

jeecg-boot:注解扫描范围问题    https://blog.csdn.net/gwcgwcjava/article/details/95967349

 

标签:jeecgframework,26,--,Springcloud,boot,springframework,org,cloud,jeecg
来源: https://www.cnblogs.com/luckyplj/p/15357692.html