I'm totally new to spring boot/gradle, so if i say something wrong, please feel free to correct me.
I have two spring boot projects and i'm using Spring Boot Gradle Plugin to run one by one in different ports and to also generate the respective jars.
I want to know if it's possible to generate one fat jar that can run both projects in different ports.
Here's the structure of my project:
Project
setting.gradle
Project-1
- src/.../@SpringBootApplication Main
- build.gradle
Project-2
- src/.../@SpringBootApplication Main2
- build.gradle
I included both projects in the setting.gradle, the Project-2 in the dependencies of Project-1 and tried gradle clean build
, but the fat jar generated in the Project-1 doesn't include the Project-2's jar. What I expected is that when I run the fat jar it exposes the two projects in their respective ports, as if I did gradle bootRun
on each project.
Is what i'm doing correct? I'm assuming that putting the Project-2 in the dependencies of Project-1 would make gradle create the fat jar I want.
Or that's not possible and I just need to use the two jars that are given to me?
Thank you for your time.