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 a Maven project with JUnit tests. I have configured this project to use an external Maven (version 2.0.9). When I build or test the whole project, it works correctly : the external Maven is launched and the build succeeds. Normally, if I right-click and choose "Test File" on a Junit test class, it launches the tests through the external Maven. In this case, my problem is that it sometimes uses the internal Maven of Netbeans instead of the external one. If I move or rename the directory of my external Maven (so that Netbeans cannot find it), the build still runs (but shows no command line at the top of the output)... and fails. The build failure is probably due to the fact that Netbeans uses a snapshot version of Maven (3.0-SNAPSHOT) : some of my test resources are not filtered. A workaround, that sometimes work, is to specify the action in nbactions.xml : <action> <actionName>test.single</actionName> <goals> <goal>test-compile</goal> <goal>surefire:test</goal> </goals> <properties> <test>${className}</test> </properties> </action> If it already exists, removing it sometimes works. Without changing my Netbeans or Maven configuration, Netbeans seems to switch between internal and external maven. If at least somebody had a workaround that always work, I would be very graceful. Currently, we have to build the entire project to test a single class...
Specifying or not specifying the "external maven home" in Netbeans option does not change its behavior. In both cases, it correctly detects my external Maven (found in PATH)
Maybe this problem is related with https://netbeans.org/bugzilla/show_bug.cgi?id=161205 ?
Would need some way to reproduce. Anyway the code to select a Maven installation will be a bit different in the next release (bug #188959).