In my case the thing was that we used "CI friendly names" with ${revision} as described in https://maven.apache.org/guides/mini/guide-maven-ci-friendly.html, but without flatten plugin (the last section).
So, everything worked when built from the parent project, but independently a submodule couldn't be built if it had dependencies inside the project.
I copied stuff from "Install / Deploy" section from the guide and everything worked fine.