Let’s make microservices a bit less complicated.

It is crucial that each piece of code you deploy have a unique version, it helps you track what your client is running, mark deployments with breaking changes, and makes your life so much easier — especially when trying to understand what changes are running at your client site in the middle of the night.

When you develop microservices, it is twice as important. Usually, you deploy your services individually and you need to know which version of which dependency is used by your service. Another requirement many developers face is how to automatically (or manually) update your dependencies when they change.

At one of my client’s projects, we had a single repository with all of the services, which were built and deployed individually. As part of our continuous integration and deployment, we’ve wanted to build only the services that were either changed or one of its dependencies has changed. I’ve also wanted to make sure that it’s easy to add new services to our system.

Then I found the  Versions Maven Plugin which can be used to automatically update versions to your Maven projects and it automatically makes sure to update all the other projects that depend on it.

In my example project ( source in GitHub) I have three services. Each service has a server and contract project and _service2 _depends on _service1 _contracts and _services3 _depends on both _service1 _and service2.

Each service has a folder with its own POM file with a subfolder for each sub-service.

#tutorial #microservices #maven #update #versioning

Versioning Multiple Microservices in a Monorepo Using Maven
5.10 GEEK