Here is the problem that we need to solve.
There is an existing Jenkins Multijob that builds application X. The application depends on the library Y, which, in turn, depends on library Z. All three components are stored in separate repos and each one is a Maven project. The way this Multijob is structured, it pulls down library Z, builds it and installs into the local Maven repo (.m2 directory). Then it moves on to the library Y, builds it and installs locally. Finally, it builds the application.
This process relies on the affinity of build process and the file system. This is not a good thing architecturally, it does not scale well for multiple distributed builders, where each builder is concerned about one repo. Besides, it wastes resources on rebuilding Y and Z, when only X has changed.
Using your knowledge of Jenkins, GitLab, Maven, and Artifactory, how would you suggest optimizing this process to migrate the said multijob in GitLab? The more architecturally sound the solution is, the better it is.