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.
Summary: | Netbeans runs maven projects tests through ant instead of maven surefire | ||
---|---|---|---|
Product: | projects | Reporter: | edvicif <edvicif> |
Component: | Maven | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | trebuchetguy |
Priority: | P3 | ||
Version: | 7.0 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
edvicif
2011-05-26 13:09:28 UTC
The default behavior, for speed, is to just pick up the (scope=test) classpath definition from Maven, add in project classes as parsed by the IDE's editor, and then run JUnit directly (the fact that Ant's <junit> is currently used for this purpose is incidental). Set File > Project Properties > Compile > Compile on Save to "Disable" if you prefer to use Surefire even for running/debugging individual test cases. This will have more overhead but will work better for projects using complex Surefire configuration. I am experiencing the same problem, and the fix listed below does resolve it, however: -It does not seem that the feature of using Surefire and using "compile on save" should be linked in this regard. These are two distinct features and should be able to be configured independently. This seems like a bug to me. -Also, there is another workaround for this problem that doesn't seem to comply with this explanation. If a user manually edits the pom.xml, saves it, then re-runs the test, the Surefire action (and not the Ant task) will run once. If the user tries to run it again (with out modifying the pom.xml), the Ant Task will execute instead. (In reply to comment #2) > It does not seem that the feature of using Surefire and using "compile on > save" should be linked in this regard. These are two distinct features No they are not. Either the IDE launches Maven with the Surefire goals; or it calls an API to directly run internally-compiled classes, which currently happens to use Ant's <junit>. > If a user manually edits the pom.xml, saves it, then > re-runs the test, the Surefire action (and not the Ant task) will run once. Under certain conditions the internally-compiled classes are either unavailable or expected to be out of date, in which case Surefire is run even if CoS is enabled generally. Typically CoS is used to quickly rerun a test after making source-code-only changes. |