version: 2
jobs:
    build:
        docker:
            - image: circleci/buildpack-deps:disco
        working_directory: ~/EasyFXML
        steps:
            - setup_remote_docker
            - checkout
            - run:
                  name: Docker build
                  command: 'docker build -t easyfxml/test .'
            - restore_cache:
                  key: dependency-cache-{{ checksum "pom.xml" }}
                  paths:
                      - ~/.m2
            - run:
                  name: Build and Test
                  command: 'docker run -v ~/.m2:/root/.m2 easyfxml/test:latest'
            - save_cache:
                  key: dependency-cache-{{ checksum "pom.xml" }}
                  paths:
                      - ~/.m2

version: 2
jobs:
    build:
        docker:
            - image: circleci/buildpack-deps:disco
        working_directory: ~/EasyFXML
        steps:
            - setup_remote_docker
            - checkout
            - run:
                  name: Docker build
                  command: 'docker build -t easyfxml/test .'
            - restore_cache:
                  keys:
                      - m2-{{ .Branch }}-{{ checksum "pom.xml" }}
                      - m2-{{ .Branch }}-{{ checksum "pom.xml" }}
                      - m2-{{ checksum "pom.xml" }}
                  paths:
                      - ~/.m2
            - run:
                  name: Build and Test
                  command: 'docker run -v ~/.m2:/root/.m2 easyfxml/test:latest'
            - save_cache:
                  key: m2-{{ .Branch }}-{{ checksum "pom.xml" }}
                  paths:
                      - /root/.m2/repository

Improve caching on circleci build
Improve caching on circleci build
