I doubt if there are good practices for distributing entities between projects. Let's say I have a microservice REST in java, that makes available a client (id, name, address) through the GET and another microservice that needs to consume this first microservice.
How could you avoid duplicating code between these two projects? Placing the client entity in a separate JAR and making the two microservers use this JAR as a dependency? Is there another way to minimize code duplication between these microservices in java?