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 241295 - [80cat] [Test specification] pom edition - dependency version code completion
Summary: [80cat] [Test specification] pom edition - dependency version code completion
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0
Hardware: PC Other
: P4 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-02 20:55 UTC by skygo
Modified: 2016-09-05 09:10 UTC (History)
1 user (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 skygo 2014-02-02 20:55:07 UTC
Testcase in [1]

 Start IDE with empty userdir
 Open some simple j2se maven project
 If Netbeans start downloading index of central repo, cancel it
 Open pom.xml
 Put carret inside <version> tag of JUnit dependency and invoke code completion 

The expected result is:
Only JUnit version that are present in local repository should be offered in code completion. Check content of your local repo in Maven repository browser window.

My result is that 4.0 is proposed but it's not present in local.(maybe code completion is working on metadata) 
I may be nice to clarify workflow.




[1] http://services.netbeans.org/synergy/client/app/index.html#/case/3900/suite/1492/v/1
Comment 1 FredJeck 2014-02-11 22:26:43 UTC
For me, even with empty user dir, the completion shows every version from local and central.
Isn't the index unpacked within netbean's installation dir ?

Product Version: NetBeans IDE 8.0 Beta (Build 201401141042)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b69
Runtime: Java(TM) SE Runtime Environment 1.8.0-b128
System: Mac OS X version 10.9.1 running on x86_64; UTF-8; fr_FR (nb)
User directory: /Users/fred/Library/Application Support/NetBeans/8.0beta
Cache directory: /Users/fred/Library/Caches/NetBeans/8.0beta
Comment 2 Milos Kleint 2014-02-12 05:32:30 UTC
(In reply to FredJeck from comment #1)
> For me, even with empty user dir, the completion shows every version from
> local and central.
> Isn't the index unpacked within netbean's installation dir ?

not, it's within the cache dir. (mavenindex/ subfolder)

> Cache directory: /Users/fred/Library/Caches/NetBeans/8.0beta
Comment 3 skygo 2014-02-19 14:54:58 UTC
@Milos thanks for the details.

This is not a bug in netbeans maven as autocompletion works, it's a mismatch test spec and netbeans.

CCing Tomas as he is author and owner of this test specification.

Some tries
I remove mavenindex in cache. 
Version autocompletion is warning user with Incomplete result, still processing indexes.
Test case => "If Netbeans start downloading index of central repo, cancel it"
*Stopping "transfering" or 
*Stopping "unpacking index for central repository" stop processus of getting new version.

Not working attempts to limit local repository indexing
*Putting maven offline
*Stopping indexing with option Completely disable indexing ... 

Clean user dir is useless.
Cleaning cache and waiting for central indexing may do the trick.

==
I have no precise idea of what is important to test.
 autocompletion ( whatever local or central)
 local repository specific?
Comment 4 skomisa 2015-10-05 05:33:16 UTC
I just ran this test case with a JUnit dependency and it worked as expected; only versions of junit in the local repository were proposed by code completion when editing pom.xml. 

Also, after a subsequent index update of the local repository some additional versions of junit were proposed by code completion (as expected).

I don't know whether it is relevant but I cleared cache before testing this functionality. 


Environment:

Product Version: NetBeans IDE 8.1 RC (Build 201510012201)
Java: 1.8.0_66-ea; Java HotSpot(TM) 64-Bit Server VM 25.66-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-ea-b02
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\JohnDoe\AppData\Roaming\NetBeans\8.1rc_alt2
Cache directory: C:\Users\JohnDoe\AppData\Local\NetBeans\Cache\8.1rc
Comment 5 alied 2015-10-30 02:43:16 UTC
(In reply to skomisa from comment #4)

> I don't know whether it is relevant but I cleared cache before testing this
> functionality. 

Same here. Added a comment about clearing cache in the test case.
Looks like this can be closed.
Comment 6 alied 2016-09-05 02:59:53 UTC
Could not reproduce:
Product Version: NetBeans IDE Dev (Build 201609040002)
Java: 1.8.0_102; Java HotSpot(TM) 64-Bit Server VM 25.102-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_102-b14
System: Linux version 4.7.2 running on amd64; UTF-8; en_US (nb)