Created
August 31, 2019 12:41
-
-
Save dartov/149a1680a50c636b418119ba653a6ebb to your computer and use it in GitHub Desktop.
CircleCI config example for multi-module maven project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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