Reputation: 11
I have 5 spring boot projects which can be deployed independently. I'm using gradle for dependency management. I have few java packages (src/main/java/...) in common that has been duplicated across all the services.
I would like to remove this redundancy by having the common java packages in a project and refer it from all 5 projects. How can I do that with help of spring modules. I'm new to Spring framework, and trying to do this.
Please help. Thanks in Advance
Upvotes: 1
Views: 105
Reputation: 423
Create another project and build a jar package of the files you would like to include.
And you can reference to that package by adding next to your module gradle (Not the app gradle file):
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile name: 'common-1.0.0'
}
Upvotes: 1