Is there a way to enforce one of many files in Apache Maven Enforcer rule "Require Files Exist"?

122 Views Asked by At

I am using the rule requireFilesExists of the Maven Enforcer Plugin. I need to enforce a README-file. This can be for example a file called README.adoc or README.md. The documentation only says that a list of files can be provided which are all enforced. But I see no way to enforce a list where only one file would be sufficient.

1

There are 1 best solutions below

0
Slawomir Jaranowski On

There are a few standard rules like: requireFiles... all rules extends class: AbstractRequireFiles.

All files given as list must satisfy rule.

You can add next parameter to AbstractRequireFiles, eg satisfyAny. Implementation should not be difficult.

Issue for track MENFORCER-430 and for fix for volunteers :-)