mojohaus / xml-maven-plugin

XML Maven Plugin
https://www.mojohaus.org/xml-maven-plugin/
Apache License 2.0
23 stars 21 forks source link

Skip validation/transformation when base directory does not exist #57

Open sewe opened 4 years ago

sewe commented 4 years ago

At the moment, defining an <execution> of the validate or transform goals in a parent POM, meant to be reused across various child projects, is really cumbersome since is requires the <dir> configured in the <validationSet> or <transformationSet> to exist in the parent, too; Otherwise, the build fails:

The directory /tmp/parent/src/main/xml, which is a base directory of a ValidationSet or TransformationSet, does not exist.

Would it be possible to implement a Skip non-existing base directory behavior, either optionally or even as a default? This would mirror the maven-resources-plugin or maven-compiler-plugin, which simply emit an [INFO] level message and skip further execution if src/main/resources or src/main/java are missing.

(Note: A partial workaround exists, using <skip>true/false<true> and <inherited>false/true</inherited> trickery, but is not pretty – and only works for a single level of inheritance.)

jochenw commented 4 years ago

Sounds reasonable to me. Will do.

sewe commented 4 years ago

Hi @jochenw. Excellent. Thanks for picking this up.

Out of curiosity: Do you already know what the default will be?