I've attached resource-test.zip which contains a project whose tests fail when the project is compiled by IDEA, but which pass when the tests are run in Maven. Workaround: When Maven has first been run and the output directory is not cleaned, then the tests pass also in IDEA.
Also, when resource-test.ipr is opened in IDEA, it complains about syntax errors in \src\test\resources\MyResource2.java even though it is technically a resource file and thus IDEA should not try to compile it. Maven does not complain about it, because it does not compile files in resource folders.
The expected behaviour (as Maven does it) is that all files in the resource directories are copied to the output directory as-is. If there are .java files in a resource directory, they should NOT be compiled (and IDEA should not complain about syntax errors in them). If the java and resource directories are the same (such as is configured for example in http://www.jdave.org/pom.xml
) then the .java files should be compiled to .class files AND the .java files should also be copied to the output folder.
This appears to be related to IDEA-14587
It would be great if this was the default for IDEA across the board. If not across the board, then at least set it for maven projects.