Pass artifact to another project

Hello, I am very new to GitLab CI, and we have two separate projects (Project A and B), and what we are trying to achieve is to pass the artifacts of project A to project B for every push in project B. I want to achieve this because the project B has a dependencies on project A.

What we have in our build.gradle file for project B is:

dependencies {
    compile project(':ProjectA')
}

When building the Project B, it gets an error because the Project A is not in the root folder of Project B because there are in a different/separate repo.
Any help or suggestions will be very much appreciated. Thanks