Missing dependency in maven multi-module project

So I’m having a really weird issue with CircleCI and a multi-module maven project (https://github.com/RichardGladman/project-bluejay).

My project builds and the tests all pass locally.

When I push to github, or re-run the workflow, the CircleCI build fails as it can’t find the rest-backend jar which is a dependency of the web app.

When I ssh into the container, I can see that there is no target directory in the rest-backend project but running .mvnw clean and .mvnw integration-test completes as expected and all tests pass.

Does anyone have any idea where to start looking for the problem?

You have to clean install first for the local dependencies to be found.

I have overrided run in config.yml to execute the Install Dependencies step:

version: 2
jobs:
  maven/test:
    docker:
    - image: circleci/openjdk:8-jdk-node
    steps:
    - checkout
    - run:
        name: Generate Cache Checksum
        command: find . -name 'pom.xml' | sort | xargs cat > /tmp/maven_cache_seed
    - restore_cache:
        key: maven-{{ checksum "/tmp/maven_cache_seed" }}
    - run:
        name: Install Dependencies
        command: mvn -DskipTests clean install dependency:resolve-plugins dependency:go-offline
    - run:
        name: Run Tests
        command: mvn verify
    - save_cache:
        paths:
        - ~/.m2
        key: maven-{{ checksum "/tmp/maven_cache_seed" }}
    - store_test_results:
        path: target/surefire-reports
workflows:
  maven_test:
    jobs:
    - maven/test
  version: 2

i can confirm this works in my maven multi-module project, too. Thank you @ron190
However, it would be very cool if it would behave the same as if it were ran on my local machine (where a simple mvn clean install in the root dir works) :slight_smile:

Remove your dependencies in your local .m2 then retry, it should fail too in your machine :wink:

Usually I stay to this principle: when my pipelines are red in the cloud then I try to figure out what I’ve done wrong locally or what have I missed. And usually yes the problem was on my side.