Search code examples
javaspringgradlemicroservices

How can I use gradle submodule as a library in another modules?


I try to write my project with four microservices, where every service need to have opportunity to call any another.

Thus I need a some client module, which will be able to call any service. And I want to use this module as a library in my services.

How can I do this?


Solution

  • Ok, You just need to create new module, then set it in settings.gradle:

    include 'service-client'
    

    And then in build.gradle of submodule where you need, add this dependency:

    compile project(':service-client')