Mvn: command not found ... but it manually works when connected via ssh to the container

Dear everybody,
I’m trying to switch to circle 2.0 to build a java application with maven. I’ve followed all the instruction found in the migration guide and I’ve looked at the example project (

Here my configuration yaml file:

version: 2

    working_directory: ~/entity-cooking
    parallelism: 1
    shell: /bin/bash --login

      CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
      CIRCLE_TEST_REPORTS: /tmp/circleci-test-results

     - image: circleci/openjdk:8-jdk-browsers

      - checkout
      - run: mvn package
      - store_test_results: # uploads the test metadata from the `target/surefire-reports` directory so that it can show up in the CircleCI dashboard.
          path: target/surefire-reports

I have two issues:

  1. the mkdir command doesn’t work. afaik it should read the env variable declared above.
  2. most critical, I get an error mvn: command not found (see example: however I was able to connect via ssh and complete the build manually.

Any hint is appreciated.

Thank you

OK so I’ve solved it right after have written this post…

  1. to solve the issue with the environment variable I’ve moved the ‘environment’ under the docker image.
  2. to solve the issue with maven I have removed --login from the shell: command.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.