Skip to content

Instantly share code, notes, and snippets.

@dartov
Created August 31, 2019 12:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dartov/149a1680a50c636b418119ba653a6ebb to your computer and use it in GitHub Desktop.
Save dartov/149a1680a50c636b418119ba653a6ebb to your computer and use it in GitHub Desktop.
CircleCI config example for multi-module maven project
version: 2
jobs:
build:
working_directory: ~/my-multi-module-mvn-prj
docker:
- image: circleci/openjdk:8-jdk-stretch
steps:
- checkout
- run:
name: Generate cumulative pom.xml checksum
command: |
find . -type f -name "pom.xml" -exec sh -c "sha256sum {} >> ~/pom-checksum.tmp" \;
sort -o ~/pom-checksum ~/pom-checksum.tmp
when: always
- restore_cache:
keys:
- my-multi-module-mvn-prj-{{ checksum "~/pom-checksum" }}
- my-multi-module-mvn-prj-
- run: mvn de.qaware.maven:go-offline-maven-plugin:resolve-dependencies
- save_cache:
paths:
- ~/.m2
key: my-multi-module-mvn-prj-{{ checksum "~/pom-checksum" }}
- run: mvn package
- 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: my-service/target/my-service.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment