首页 > 其他分享 >提供独立的模块 被其他Spring boot项目应用

提供独立的模块 被其他Spring boot项目应用

时间:2024-02-26 10:47:40浏览次数:15  
标签:xia Spring boot blog client 模块 com

 

 

@ComponentScan({"com.xia.blog.client"}) //被扫描的包  可以有注解@Service @Dao 等
@EnableFeignClients({"com.xia.blog.client"})
public class MyConfiguration {
}

 

 

在resources/META-INF/spring.factories文件中加入

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.xia.blog.client.MyConfiguration

 

该模块的pom  

<build>
<resources>
<!--打包代码文件夹内所有文件-->
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>

</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>

<include>**/*.properties</include>

<include>**/*.xml</include>

<include>**/*.factories</include>
<include>**/*.yml</include>

</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>

 

com.xia.blog.client包的类在其他应用中被自动注入到Spring容器中

标签:xia,Spring,boot,blog,client,模块,com
From: https://www.cnblogs.com/xiamingqing/p/18033793

相关文章

  • springBoot 整合 groovy 实现表达式解析 该示例可以用于配置告警规则
    1.引入pom<dependency><groupId>org.codehaus.groovy</groupId><artifactId>groovy</artifactId><version>3.0.9</version></dependency><dependency......
  • 【Mybatis-Plus】Mybatis-Plus 是如何整合到 SpringBoot 中的呢?
    1 前言上次我们看了Mybatis是如何整合到SpringBoot的,那么平时我们可能直接用的就是Mybatis-Plus,那么它又是如何结合到的SpringBoot的呢?原理其实是一样的,这节我们就来看看。看的过程中,其实会深深体会Mybatis-Plus就是对Mybatis的增强,类似SpringBoot对Spring的增......
  • SpringBoot:通过实现自定义接口获取实现类的@RequestMapping注解请求路径
    1.自定义接口//什么都不用写,就定义一个空接口publicinterfaceMyMark{}2.Controller接口类实现自定义接口@RestControllerpublicclassDayControllerimplementsMyMark{@RequestMapping("/day1")publicStringget1(){return"day1";}......
  • 【Mybatis】Mybatis 是如何整合到 Spring 中的呢?
    1 前言当你把Spring、SpringBoot、Mybatis或者Mybatis-Plus的源码都看过后,那有没有想过比如Mybatis如何整合到Spring或者SpringBoot的呢?就是思考框架跟框架之间的融合,那么这节我们就来看看单纯的Mybatis是如何融合到SpringBoot的。融合Spring的就不看了,毕竟大......
  • 使用SpringSecurity相关说明
    原理探析思路实现密码加密存储......
  • Lua学习笔记之迭代器、table、模块和包、元表和协程
    迭代器迭代器是一种对象,它能够来遍历标准库模板容器中的部分或全部元素,每个迭代器对象代表容器中确定的地址,在Lua中迭代器是一种支持指针类型的结构,他可以遍历集合的每一个元素。泛型for迭代器泛型for自己内部保存迭代函数,实际上保存三个值:迭代函数、状态常量、控制变量。泛型......
  • ssts-hospital-web-master项目实战记录十六:项目迁移-模块实现(page-info)
    记录时间:2024-02-25二、page-info模块实现framework/page-info/index.ts//javascript用来遍历指定对象所有的属性名称和值//obj需要遍历的对象constallProps=function(obj:any,props:string=''):string{ //使用Object.keys()获取对象自身的所有属性键 ......
  • ssts-hospital-web-master项目实战记录十四:项目迁移-模块实现(log-local)
    记录时间:2024-02-25一、log-local模块实现framework/config/index.ts//终端日志文件配置constLogTerminalInfoDir='D:\\LogInfo\\LogTerminalInfo\\'constLogTerminalInfoFileNamePrefix='LogTerminalInfo'//错误页面快照文件配置constLogErrorPageSnapshotFil......
  • spring6入门开发案例步骤
    引入依赖创建类和方法编写配置文件4.测试Spring是如何创建对象的呢?原理是什么?//dom4j解析beans.xml文件,从中获取class属性值,类的全类名//通过反射机制调用无参数构造方法创建对象Classclazz=Class.forName("com.atguigu.spring6.bean.HelloWorld");//Objectobj......
  • C# vs2015 .dll模块联合开发好的应用程序进行调试
    C#vs2015.dll模块联合开发好的应用程序进行调试右键项目->属性,1.点击“调试”侧边菜单,在“启动操作”选项中选择“启动外部程序”,然后选择应用程序的exe文件的路径2.点击“生成”侧边菜单,在“输出”选项中“输出路径”中选择将当前调试项目的最新dll文件(最新的代码)输出到应用......