Skip to content

Commit 7258f28

Browse files
committed
Add example showing how to override default reconciliation configs
Users override defaults by adding executionControl configuration to their .mvn/maven-build-cache-config.xml file, not by creating resource files. Added concrete example for maven-compiler-plugin.
1 parent 08b0ee6 commit 7258f28

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/site/markdown/how-to.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,31 @@ The build cache extension automatically tracks certain critical plugin propertie
171171
This default behavior prevents common cache invalidation issues, particularly in multi-module JPMS (Java Platform Module System)
172172
projects where compiler version changes can cause compilation failures.
173173

174-
**Important:** When you explicitly configure `executionControl` for a plugin, your explicit configuration completely overrides
175-
the defaults for that plugin. However, defaults still apply to other plugins that aren't explicitly configured.
174+
**Overriding Defaults:** When you explicitly configure `executionControl` for a plugin, your explicit configuration completely
175+
overrides the defaults for that plugin. For example, to track only the `release` property for maven-compiler-plugin instead
176+
of the default `source`, `target`, and `release`:
176177

177-
**Extending Beyond Defaults:** You can define reconciliation configurations for plugins that don't have built-in defaults by
178-
adding them to your `executionControl` configuration as shown in the examples above.
178+
```xml
179+
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.2.0">
180+
<configuration>
181+
...
182+
</configuration>
183+
<executionControl>
184+
<reconcile>
185+
<plugins>
186+
<plugin artifactId="maven-compiler-plugin" goal="compile">
187+
<reconciles>
188+
<reconcile propertyName="release"/>
189+
</reconciles>
190+
</plugin>
191+
</plugins>
192+
</reconcile>
193+
</executionControl>
194+
</cache>
195+
```
196+
197+
This configuration in your `.mvn/maven-build-cache-config.xml` file replaces the built-in defaults. You can also define
198+
reconciliation configurations for plugins that don't have built-in defaults using the same syntax.
179199

180200
### Parameter Validation and Categorization
181201

0 commit comments

Comments
 (0)