Skip to content

Commit 98eccf1

Browse files
AlexanderAshitkinaashitkignodet
authored
Documentation updates (apache#28)
* Documentation updates - fixed references to config file after rename, added notes about subtree discovery * Documentation updates - reworded subtree build section Co-authored-by: aashitki <alex.ashitkin@db.com> Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
1 parent 6343531 commit 98eccf1

File tree

4 files changed

+32
-17
lines changed

4 files changed

+32
-17
lines changed

src/site/markdown/getting-started.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
To 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)
4242
to [`.mvn/`](https://maven.apache.org/configure.html) directory of your project.
4343
To 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

5454
Having 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

6366
It is recommended to find the best working trade-off between fairness and cache efficiency. Adding unnecessary rules and
6467
checks could reduce both performance and cache efficiency (hit rate).

src/site/markdown/how-to.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Absolutely minimal config
2626

2727
```xml
2828
<?xml version="1.0" encoding="UTF-8" ?>
29-
<cache xmlns="http://maven.apache.org/CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30-
xsi:schemaLocation="http://maven.apache.org/CACHE-CONFIG/1.0.0 http://maven.apache.org/xsd/cache-config-1.0.0.xsd">
29+
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30+
xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 http://maven.apache.org/xsd/cache-config-1.0.0.xsd">
3131

3232
<configuration>
3333
<enabled>true</enabled>

src/site/markdown/usage.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,23 @@ Once extension is activated, cache will kick-in automatically on every lifecycle
2424
Build could be invoked on any module in project and will try to discover cache by introspecting dependencies. In order
2525
to identify which dependencies are part of cacheable project the cache engine needs to know:
2626

27-
* full project root location which must be passed with `-Dmaven.multiModuleProjectDirectory`
28-
* Specify profiles which activate full graph in config:
27+
* Full project root location which must be passed with `-Dmaven.multiModuleProjectDirectory`
28+
* Profiles which activate full graph in project build. Underlying implementation logic is to introspect reactor
29+
graph in `full` mode to discover which dependencies are part of the full project and cacheable. This information will
30+
be used when subtree is being build to identify dependencies as a part of a wider project and process them from cache:
2931

30-
```
31-
TBD
32+
```xml
33+
<configuration>
34+
...
35+
<multiModule>
36+
<discovery>
37+
<scanProfiles>
38+
<scanProfile>my-full-project-profile</scanProfile>
39+
</scanProfiles>
40+
</discovery>
41+
</multiModule>
42+
...
43+
</configuration>
3244
```
3345

3446
## Disable cache

src/site/resources/maven-build-cache-config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
-->
18-
<cache xmlns="http://maven.apache.org/CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19-
xsi:schemaLocation="http://maven.apache.org/CACHE-CONFIG/1.0.0 target/generated-resources/modello/build-cache-config-1.0.0.xsd">
18+
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache¬.org/BUILD-CACHE-CONFIG/1.0.0 target/generated-resources/modello/build-cache-config-1.0.0.xsd">
2020

2121
<!--
2222
Template Maven build cache configuration

0 commit comments

Comments
 (0)