version: 2
jobs:
  build:
    working_directory: /workspace
    docker:
    - image: openjdk:8-jdk
    environment:
      MAVEN_OPTS: -Xmx512m
      DOCKER_VERSION: 17.04.0-ce

    steps:
      - setup_remote_docker

      - checkout

      - run:
          name: Maven
          command: ./mvnw --batch-mode install

      - run:
          name: Collect junit reports
          command: |
            mkdir ./junit/
            find . -type f -regex ".*/target/.*-reports/.*xml" -exec cp {} ./junit/ \;

      - store_test_results:
          path: ./junit

version: 2
jobs:
  build:
    working_directory: /workspace
    docker:
    - image: openjdk:8-jdk
    environment:
      MAVEN_OPTS: -Xmx512m
      DOCKER_VERSION: 17.04.0-ce

    steps:
      - setup_remote_docker

      - checkout

      - run:
          name: Maven
          command: ./mvnw --batch-mode install checkstyle:check

      - run:
          name: Collect junit reports
          command: |
            mkdir ./junit/
            find . -type f -regex ".*/target/.*-reports/.*xml" -exec cp {} ./junit/ \;

      - run:
          name: Collect checkstyle reports
          command: |
            mkdir ./checkstyle/
            find . -type f -regex ".*/target/checkstyle.*xml" -exec cp {} ./checkstyle/ \;

      - store_test_results:
          path: ./junit

      - store_artifacts:
          path: ./junit

      - store_artifacts:
          path: ./checkstyle

Enable checkstyle in circleci build
chore: Enable checkstyle in circleci build
