Is there any possibility in swagger2 to create a centralized swagger document for two different spring boot projects? - spring-boot

I have two spring boot projects namely A and B. Now, I need to create a centralised swagger document for both A and B projects. Any ways to do it other than with maven multi-modules?
Thanks in advance

Related

Import and use a spring security project in a spring boot project

I'm a beginner in Spring Framework.
I created in two separate projects:
Project "A" for Spring Security and JWT with a DB for User, Permission, Role, etc. Used for authentication and permissions;
Project "B" for Spring Boot with a DB for business tables. Used as a backend for a web-app;
Both projects have controllers and starters (do not import).
I would like to know how to use authentication check ( JWTFilter ) and permissions ( PermissionEvaluator ) from the security project in the backend project.
In the future, I want to use same spring security project for multiple spring boot projects.
If necessary, I can add the basic structure (packages) of each project.
AGGIORNAMENTO
After so much research, Should I separate Spring Security from Spring Boot project and Spring Boot configure and use two data sources threads were very helpful in solving my problem.
However, in my case I didn't need to diversify the dataSource because the DB is unique but with a different schema for the business and security tables.
Then, I added the "schema" key to the spring #Table annotation. Also, to solve the problem for visibility of the repositories and entities I added the spring annotations #ComponentScan, #EnableJpaRepository and #EntityScan
You have two approaches to implement your project:
Deploy all packages of project B in the project A. this approach appropriate for small project.
Similar the approach 1 use the multi module architecture that is a clean way to implement. but in this approach you must set basic package in all of the modules

Spring Data JPA project as dependency of Spring Boot project

I would like to have a microservice project using Spring Boot that gets access to Entities and DAOs through a dependency that is created through Spring Data JPA project. The idea is that multiple microservices could get that dependency.
However, when the jar is assembled in the Spring Boot Data JPA project, a lot of dependencies are included in it through starter dependencies. Most them are also present in the Spring Boot Microservice project that uses it.
How would you go about building a jar through Spring Data JPA with just Entities and Repositories? I have not found any clear examples on how to achieve this, not sure If I am off with my thinking or not.
Thanks in advance.
To my view point, sharing domain entities between microservices is fundamentally wrong in microservices architecture.
Please learn about Domain Driven Design modelling. There are lots of articles and videos available on the internet.
Domain Driven Design
Bounded Context
Sharing means no duplication but more coupling.
Duplication leads to less coupling.

Create both Spring and Spring Boot variants of an application using Maven

Our Existing Parent Project using spring 4.3.3.RELEASE, we are trying provide part of it as a Spring Boot Application and the other parts as a Spring.
To do this it seems we must create a Maven project that has two parents: our existing parent project and the Spring Boot parent. How can we do that?
Split the project into 3 parts, each with a POM. Most of the code goes in a "core" project. The other two are a "spring boot" and a "spring app" projects. Those two have the "core" as a dependency. The differences for Spring Boot and Spring go in those two projects.
Each project can have but one parent POM.

Spring Data Rest vs Spring Data Rest WebMvc

What is the difference between:
spring-data-rest
and
spring-data-rest-webmvc
To obviously they are two different things, but I am slightly confused here.
The spring-data-rest-webmvc is the project describing the main concepts of spring-data-rest which is the one of the main spring modules.
In most cases one will use spring-data-rest dependency for his/her project.
Use spring-data-rest when your app is based on Spring Boot
spring-data-rest-webmvc when your app is not a Spring Boot app
Ref: https://docs.spring.io/spring-data/rest/docs/current/reference/html/#install-chapter

adding spring-data-rest ontop of spring-data-jpa

i created a maven project, and added all dependencies i need.
i have some repositories using the spring-data-jpa, and i added some integration tests.
now i need to add ontop of it spring-data-rest, if i understand it is based on springmvc.
but all examples i found, i need to add spring boot to start the app.
i noticed also all new spring projects use spring boot.
this means that i have to learn and use it for my projects?
how can i use spring-data-jpa+spring-data-jpa with an existing servlet3 project
The reason all examples are written using Boot is that Boot is indeed the way you should start a new Spring project these days. It free's from a lot of the tedious work of setting up the infrastructure, finding dependencies in the right version etc.
To use Spring Data REST without Boot, simply add the necessary dependencies to your project. The easiest way to do this is to use the Spring Data Release Train BOM (which will help you pulling in the correct matching versions) along side the version-less dependency declarations for Spring Data REST WebMVC and - in your case - Spring Data JPA.
Then go ahead and either register RepositoryRestMvcConvfiguration as Spring bean (either through XML configuration or JavaConfig).
All of this is also documented in the reference documentation.

Resources