Maven build fails to download dependencies in spring boot docker image two stage build

On gitlab CI we have the following Docker image build (two stage) of a spring boot project

It fails downloading the dependencies, a different jar or pom every time, they are only a few kb.

Locally it runs.

Any idea what could be wrong ? Or how to debug this?

FROM maven:3.6.3 AS maven

WORKDIR /usr/src/app
COPY . /usr/src/app

RUN mvn clean package

# For Java 11,
FROM adoptopenjdk/openjdk11:alpine-jre

ARG JAR_FILE=some.jar

WORKDIR /opt/app

COPY --from=maven /usr/src/app/target/${JAR_FILE} /opt/app/

ENTRYPOINT ["java","-jar","some.jar"]