I can use the evaluateBeanshell rule to enforce some convention: no colon's in directories below src.
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce-beanshell</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<evaluateBeanshell>
<condition>org.codehaus.plexus.util.FileUtils.getDirectoryNames(new File("src"), "**/*:*", null, false).isEmpty()</condition>
</evaluateBeanshell>
</rules>
</configuration>
</execution>
</executions>
</plugin>
But some projects don't have an src directory, and the rule will fail hard. I tried setting
<condition>org.codehaus.plexus.util.FileUtils.getDirectoryNames(new File("."), "src/**/[^A-Z]*", null, false).isEmpty()</condition>
How do I safely catch the non-existence of the src directory?
This does what I need