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 222942

Summary: 'Move Unmanaged Dependency to Dependency Management' hint doesn't work for current pom.xml
Product: projects Reporter: mienamoo
Component: MavenAssignee: Milos Kleint <mkleint>
Status: VERIFIED FIXED    
Severity: normal CC: markiewb
Priority: P3 Keywords: PATCH_AVAILABLE
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 223226    
Bug Blocks:    
Attachments: patch

Description mienamoo 2012-11-29 07:11:23 UTC
NetBeans build 201211260002
JDK 7u9 64-bit

While testing the Maven sanity test spec [1], I was testing the 'Move Unmanaged Dependency to Dependency Management' hint. The first project I was working with was a Maven-based Java Application. I tried to move a dependency to the management section. All that it did was add

    <dependencyManagement/>

and the original dependency remained unchanged. The hint remained there and could be triggered multiple times with no subsequent effect.

Then I tried on a NetBeans Platform module that is part of a NetBeans Platform Application. When moving to the dependency management section of the module's pom.xml, the same happens. When moving it to the parent's dependency management it works as expected.

[1] http://wiki.netbeans.org/STS_73_Maven#Test_suite:_Edit_pom.xml_file
Comment 1 Milos Kleint 2012-12-04 12:28:06 UTC
Created attachment 128834 [details]
patch

patch to be applied once the new xml api addition is included in the build.
Comment 2 Milos Kleint 2012-12-12 09:36:41 UTC
http://hg.netbeans.org/core-main/rev/af5cbdebc623

we've always had rather heuristic methods of how to get from selected text to selected dependency, now with the new api in xam modules we only include those dependencies that are entirely selected.. starting before <dependency> and ending after </dependency>
Comment 3 Quality Engineering 2012-12-14 02:43:48 UTC
Integrated into 'main-golden', will be available in build *201212140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/af5cbdebc623
User: Milos Kleint <mkleint@netbeans.org>
Log: #222942 both start and end boundaries of dependency element have to be included in selection in order to trigger the hint
Comment 4 mienamoo 2012-12-14 07:38:50 UTC
Verified with build 201212140001. Thanks!