[英]Spring Boot library usage in plain Java project
i´m currently working on a Spring Boot jar library for reuseable components like 我正在开发一个Spring Boot jar库,用于可重用的组件
Aim: 目标:
Every Java "user/coder" of our company should be able to "put" this jar in ones project (by maven or whatever) and use the reusable components instead of coding all things by hand over and over again. 我们公司的每个Java“用户/编码器”都应该能够将这个jar“放”到一个项目中(通过maven或其他)并使用可重用的组件而不是一遍又一遍地编写所有东西。
Building microservices for that issue over REST is not an alternative to us. 通过REST构建针对该问题的微服务不是我们的替代方案。
My question is: 我的问题是:
Can i reuse this Spring Boot jar library in any plain Java projects? 我可以在任何普通的Java项目中重用这个Spring Boot jar库吗?
Beeing fond, can i "put" this jar library into a Java project and wire my Spring Boot services from that library in my "non Spring Boot" vanilla Java project? Beeing喜欢,我可以将这个jar库“放”到Java项目中,并在我的“非Spring Boot”vanilla Java项目中从该库连接我的Spring Boot服务吗?
Notice / Edited: 通知/编辑:
I have used Spring Boot as project template ( spring-boot-starter-parent
). 我使用Spring Boot作为项目模板(
spring-boot-starter-parent
)。
I configure my templates like the LdapTemplate
by hand and don´t let Spring Boot do the magic. 我手动配置我的模板,如
LdapTemplate
,不要让Spring Boot发挥魔力。
Edit 编辑
As far as the reuse in Spring Boot/Spring projects is concerned, everything is fine. 就Spring Boot / Spring项目的重用而言,一切都很好。 I´ve done that already.
我已经这样做了。
My aim with that library may be that every Java "user" can use this library, like so: 我对该库的目标可能是每个Java“用户”都可以使用这个库,如下所示:
final SuperCoolLibary scl = new SuperCoolLibrary(); final boolean exists = scl.searchForLdapUser("tlang");
So another question maybe: 另外一个问题可能是:
Would it be better do switch this library to maybe the new Java Jigsaw module infrastructure? 将此库切换到新的Java Jigsaw模块基础结构会更好吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.