gnodet opened a new pull request, #535:
URL: https://github.com/apache/maven-resources-plugin/pull/535
Users can configure a change-detection strategy per `<resource>` block
(inside the plugin `<configuration>`) that overrides the mojo-level
`changeDetection` parameter for that resource. The underlying support was
already implemented in maven-filtering's `Resource.changeDetection` field
and in `DefaultMavenResourcesFiltering` (which checks per-resource override
before falling back to the request-level strategy).
This PR:
- **Documents** the per-resource `<changeDetection>` capability in the
Javadoc
of the `changeDetection` parameter, with a full POM example
- **Adds integration test** `MRESOURCES-286` that configures two resource
directories with different per-resource strategies:
- `changeDetection=NEVER` — verifies a pre-existing destination file is
NOT overwritten
- `changeDetection=ALWAYS` — verifies the source content is always copied
Example configuration:
```xml
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<resources>
<resource>
<directory>src/main/resources</directory>
<changeDetection>ALWAYS</changeDetection>
</resource>
<resource>
<directory>src/main/generated</directory>
<changeDetection>NEVER</changeDetection>
</resource>
</resources>
</configuration>
</plugin>
```
No code changes were needed — the wiring already works via Maven's plugin
configurator injecting values into the filtering `Resource` POJO.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]