You can do this in Administration -> Configuration -> Analysis Scope -> Restrict Scope of Coding Rules. You need to specify the code of the rule (without spaces) and a file path pattern to filter. If you use the maven standard **/src/main/** will work for you.
For more information see the docs where it states that you can:
...exclude files/directories ...
You can only suppress warnings at the project level, as you said, and at the file/method level. For file/method, it will depend on your language. In Java, you would add an annotation such as: