2020To on-board incremental Maven you need to complete several steps:
2121
2222* Declare caching extension in your project (either in ` pom.xml ` or ` .mvn/extensions.xml ` )
23- * Add ` maven-cache-config.xml ` cache config in ` .mvn/ ` (optional) to customize default behavior
23+ * Add ` maven-build- cache-config.xml ` cache config in ` .mvn/ ` (optional) to customize default behavior
2424* Validate build results and iteratively, adjust config to properly reflect project specifics
2525* Setup remote cache (optional)
2626
@@ -38,27 +38,30 @@ either in `pom.xml`'s `<project>/<build>/<extensions>` or in `.mvn/extensions.xm
3838
3939### Adding build cache config
4040
41- Copy [ default config ` maven-build-cache-config.xml ` ] ( ../resources/maven-build-cache-config.xml )
41+ Copy template config [ ` maven-build-cache-config.xml ` ] ( ../resources/maven-build-cache-config.xml )
4242to [ ` .mvn/ ` ] ( https://maven.apache.org/configure.html ) directory of your project.
4343To get overall understanding of build cache machinery, it is recommended to review the config and read comments. In typical
44- scenario you need to adjust :
44+ scenario you need to:
4545
46- * Exclusions for unstable, temporary files or environment specific files
47- * Plugins reconciliation rules – add critical plugins parameters to reconciliation
48- * Source code files selectors. Though source code locations discovered automatically from project and plugins config,
46+ * Exclude unstable, temporary files or environment specific files
47+ * Add plugins reconciliation rules – add critical plugins parameters to reconciliation
48+ * Configure precise source code files selectors. Though source code locations discovered automatically from project and plugins config,
4949 there might be edge cases.
50- * remote cache location (if remote cache is used)
50+ * Add remote cache location (if remote cache is used)
5151
5252### Adjusting build cache config
5353
5454Having extension run usual command, like ` mvn package ` . Verify the caching engine is activated:
5555
56- * Check log output - there should be cache related output or initialization error message.
56+ * Check log output - there should be cache related output or initialization error message:
57+ ```
58+ [INFO] Loading cache configuration from <project dir>/.mvn/maven-build-cache-config.xml
59+ ```
5760* Navigate to your local repo directory - there should be a sibling directory ` cache ` next to the usual
5861 local ` repository ` .
5962* Find ` buildinfo.xml ` in the cache repository for typical module and review it. Ensure that
6063 * expected source code files are present in the build info
61- * all critical plugins and their critical parameters are covered by config
64+ * Review all plugings used in the build and add their critical parameters to reconciliation
6265
6366It is recommended to find the best working trade-off between fairness and cache efficiency. Adding unnecessary rules and
6467checks could reduce both performance and cache efficiency (hit rate).
0 commit comments