version: 2.1

executors:
  my-executor:
    docker:
      - image: circleci/openjdk:8-jdk
    resource_class: large
    working_directory: ~/nexus-public
    environment:
      MAVEN_OPTS: -Xmx3200m
      OPENSSL_CONF: /

jobs:
  build:
    executor: my-executor
    steps:
      - run:
          name: Core count
          command: |
            echo "Threads/core: $(nproc --all)"
      - run:
          name: Memory
          command: free -m
      - checkout
      - run: mvn -U clean install
      - run:
          name: Save test results
          command: |
            mkdir -p ~/test-results/junit/
            find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
          when: always
      - store_test_results:
          path: ~/test-results
      - store_artifacts:
          path: ~/test-results/junit

  deploy-snapshot:
    executor: my-executor
    steps:
      - checkout
      - run:
          name: Deploy Snapshot
          command: |
            mvn -s .circleci/circleci.settings.xml deploy -DskipTests

workflows:
  build-deploy-snapshot:
    jobs:
      - build:
          filters:
            branches:
              ignore: nexus-2.x
      - deploy-snapshot:
          filters:
            branches:
              only: master
          requires:
            - build

version: 2.1

executors:
  my-executor:
    docker:
      - image: cimg/openjdk:8.0
    resource_class: large
    working_directory: ~/nexus-public
    environment:
      MAVEN_OPTS: -Xmx3200m
      OPENSSL_CONF: /

jobs:
  build:
    executor: my-executor
    steps:
      - run:
          name: Core count
          command: |
            echo "Threads/core: $(nproc --all)"
      - run:
          name: Memory
          command: free -m
      - checkout
      - run: mvn -U clean install
      - run:
          name: Save test results
          command: |
            mkdir -p ~/test-results/junit/
            find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
          when: always
      - store_test_results:
          path: ~/test-results
      - store_artifacts:
          path: ~/test-results/junit

  deploy-snapshot:
    executor: my-executor
    steps:
      - checkout
      - run:
          name: Deploy Snapshot
          command: |
            mvn -s .circleci/circleci.settings.xml deploy -DskipTests

workflows:
  build-deploy-snapshot:
    jobs:
      - build:
          filters:
            branches:
              ignore: nexus-2.x
      - deploy-snapshot:
          filters:
            branches:
              only: master
          requires:
            - build

Update to modern circleci openjdk image.
Update to modern circleci openjdk image.
