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.

Bug 180006 - Netbeans 6.8 sometimes uses internal Maven instead of external Maven
Summary: Netbeans 6.8 sometimes uses internal Maven instead of external Maven
Status: RESOLVED INCOMPLETE
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: David Simonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-29 12:12 UTC by bmaras
Modified: 2010-07-28 15:46 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bmaras 2010-01-29 12:12:40 UTC
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...
Comment 1 bmaras 2010-01-29 12:16:22 UTC
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)
Comment 2 bmaras 2010-03-17 17:51:52 UTC
Maybe this problem is related with https://netbeans.org/bugzilla/show_bug.cgi?id=161205 ?
Comment 3 Jesse Glick 2010-07-28 15:46:50 UTC
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).