My javacode checked out by circleci is not found when I use Dockerfile

I am not very experienced using Docker , but I want to build an image that runs java and springboot as I want to run some tests on the running application (not just junit tests)

I have to dockerfile for dockerfile build

FROM maven:3.9.16-eclipse-temurin-17 AS build

# Build the application using Maven

RUN mvn clean package -DskipTests
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]

But this is the log error from pipeline build:

The goal you specified requires a project to execute but there is no POM in this directory .

I need to run maven package to create the application jar file in order to be able to set the entrypoint

For me it seems that docker doesnt find the files from cirlcleci checkout

My job (what happens after build might not work either, but for now I focus to get docker build to work and now its the Dockerfile that is the problem

jobincmaven:
  docker:
    - image: cimg/base:2026.07

  steps:
    - checkout
    - setup_remote_docker:
        docker_layer_caching: true
    - run:
        name: Build an image
        command: |
          docker build --tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME$CIRCLE_SHA1 .
    - run:
        name: Run application in background
        command: |
          docker run  -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME$CIRCLE_SHA1
            background: true