Skip to content

Commit d42d25a

Browse files
committed
add dartov's contribution
1 parent 37067fd commit d42d25a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

jekyll/_cci2/language-java-maven.md

+18
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,24 @@ Next we pull down the cache, if present. If this is your first run, or if you've
117117
project build. If this is the case, consider using the <a href="https://github.com/qaware/go-offline-maven-plugin">go-offline-maven-plugin</a>.
118118
</div>
119119

120+
Multi-module cache should depend on pom.xml in every module, it could be achieved with this additional step:
121+
122+
{% raw %}
123+
```yaml
124+
...
125+
steps:
126+
- checkout
127+
- run:
128+
name: Generate cumulative pom.xml checksum
129+
command: |
130+
find . -type f -name "pom.xml" -exec sh -c "sha256sum {} >> ~/pom-checksum.tmp" \;
131+
sort -o ~/pom-checksum ~/pom-checksum.tmp
132+
when: always
133+
- restore_cache:
134+
key: circleci-demo-java-spring-{{ checksum "~/pom-checksum" }}
135+
```
136+
{% endraw %}
137+
120138
Then `mvn package` runs the actual tests, and if they succeed, it creates an "uberjar" file containing the application source along with all its dependencies.
121139

122140
Next `store_test_results` uploads the test metadata from the `target/surefire-reports` directory so that it can show up in the CircleCI dashboard.

0 commit comments

Comments
 (0)