Gitlab ci maven with java 14

I’m building a ci pipeline to compile maven project A which has a dependency on project B. in this context i have 2 questions:

1- What’s the correct docker image to use for java 14? i’m using maven:3-jdk-11 and it’s working but it forced me downgrade the project to java 11. I tried maven:3-jdk-14 and it gives a lot of errors on commands like git and apt-get

2- i’m using the following steps to install project B first then run mvn compile on project A, still the image can’t find the maven dependency, although project A did install to local repository successfully.

stage: build

the error is:

[ERROR] Failed to execute goal on project A: Could not resolve dependencies for project B:jar:0.0.1-SNAPSHOT: Could not find artifact B:jar:1.0-SNAPSHOT in spring-milestones ( -> [Help 1]

Thank you