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 252596 - Code suggestion accepted stops maven from building in netbeans
Summary: Code suggestion accepted stops maven from building in netbeans
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0.2
Hardware: Macintosh Mac OS X
: P1 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-26 15:00 UTC by hasting
Modified: 2015-06-05 02:39 UTC (History)
0 users

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 hasting 2015-05-26 15:00:13 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Mac OS X version 10.9.5 running on x86_64
Java; VM; Vendor = 1.8.0_31
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.31-b07

Testing a stateless session bean I accepted a code completion hint to use @EJB to inject class under test. A previously working test (jUnit with some mockito mocking) stopped working. I reverted to last successful test and tried to test the file. Maven will not clean install from netbeans but will from the command line.

ailed to execute goal on project ProjectName: Could not resolve dependencies for project com.project:ProjectName:war:1.0-SNAPSHOT: Could not find artifact com.project:ProjectName:jar:1.0-SNAPSHOT -> [Help 1]
Comment 1 hasting 2015-05-26 16:06:26 UTC
It seems the code suggestion places a dependency to the project itself under the Dependencies tab under the project in the Projects window. Removal of this dependency allows netbeans to run tests correctly.

As a correction to the initial report, mvn clean install on the command line also fails.

To reproduce:
Create a maven web project using nb wizard.
add a stateless annotated ejb
add a method.
create junit test

Instantiate class under test as MyClass cut = new MyClass();
NB offers a code suggestion, take the suggestion and the dependency as described above is created. The test will not run.
Removal of the automated code insert and removal of dependency 'fixes' the breakage.


Best.
Comment 2 Tomas Stupka 2015-06-03 12:47:48 UTC
fixed in jet-main #792b11b1dea0
Comment 3 Quality Engineering 2015-06-05 02:39:18 UTC
Integrated into 'main-silver', will be available in build *201506050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/792b11b1dea0
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #252596 - Code suggestion accepted stops maven from building in netbeans