I have docker-compose with the following projects:
RabbitMQ management, producer and consumer,
producer and consumer (java springboot apps) share a maven dependency to common model api (3rd mini project containing POJOs used by producer and consumer).
When I build everything locally with mvn and each dockerfile contains only copying jar and running the app everything works fine.
I tried to use multi-stage dockerfile but there is an error stating my producer can't find dependency for model-api on maven-central (from where it downloads all other dependencies).
I have tried using RUN mvn dependency:go-offline
so it uses my local .m2/repo but no success, same error and still downloads dependencies from central.
How can I make it work?