Add Rule to exclude from the java-maven projects

We 'd like to add a rule to detect file and give an error.

I’ve tried Regexp On Filename Template. I don’t why it’s not working. Somebody could tell me if it is a good solution and if it is which should be the values? I’m trying and don’t get anything and i don’t find any examples.