This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have not been able to create a small set of projects illustrating this issue and unfortunately the project where I have encountered the issue is proprietary so I am limited to just describing the issue. I have two projects, project A contains annotations and project B is the annotation processor for the annotations. In project B I am using Mockito to mock instances of the annotations from project A in the test classes. When I run 'Test File' on one of these unit tests I get a NoClassDefFoundError on the annotation class from project A. When I run 'Test' on the project all of the tests run and complete successfully. If I run a focused test outside the IDE using mvn the test completes successfully. I attempted as best I could to reproduce what NB was doing when running 'Test File' using a command line. This is what I ran: set JAVA_HOME=C:\Java\jdk1.7.0_51 set M2_HOME=U:\maven\apache-maven-3.3.3 %M2_HOME%\bin\mvn.cmd ^ -Dtest=my.test.class.MyTest ^ -Dmaven.ext.class.path="C:\Program Files\NetBeans 8.1\java\maven-nblib\netbeans-eventspy.jar;C:\Program Files\NetBeans 8.1\java\maven-nblib\netbeans-cos.jar ^ test-compile surefire:test The above test ran successfully. I went into the project properties for project B and changed the 'Test File' action Execute Goals from "test-compile surefire:test" to "test". After making that change the 'Test File' action would complete successfully. The configuration change I noted is an acceptable workaround. Mostly I am just filing this bug for documentation purposes (especially since I can't reproduce it in a project I can supply).