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.
Currently, when you add a dependency to a project by using the wizard, the POM of the project gets updated with groupId-artifactId-version-artifactType. Best practices for Maven predicate that all version numbers are consolidated in a single dependencyManagement section. So, NetBeans should search for such a section in the current POM, then in the parent POM and all ancestors. If no groupId-artifactId entry is found, one is created with the version. If it's found and version is the same, nothing should be done. If it's different, a notification to the user should be shown, allowing him to decide whether he wants to update the previously entered version or use that one in place of the one picked by the wizard. As a minor remark, artifactType should be omitted if it's 'jar', the default, to reduce cluttering.
(In reply to comment #0) > NetBeans should search for such a > section in the current POM, then in the parent POM and all ancestors. ...but behave as now if there is no such section in the effective POM, since the user may just not care about dM in this case. > If no groupId-artifactId entry is found, one is created with the version. Potentially tricky, since it is not obvious which ancestor you wanted this defined in, if several define dM. > allowing him to decide whether he > wants to update the previously entered version or use that one in place of the > one picked by the wizard. ...or to behave as now, overriding the managed version. > artifactType should be omitted if it's 'jar', the default That is already true, at least in 7.1 (but I think in earlier releases too). But please keep unrelated remarks in their own issues.
"Potentially tricky, since it is not obvious which ancestor you wanted this defined in, if several define dM." It makes sense, IMHO, to use the first dM section found crawling up the parent hierarchy. "That is already true, at least in 7.1 (but I think in earlier releases too)." I still see <type>jar</type> being added by 7.1.
which wizard are we talking about here?
I think reporter was referring to the Add Dependency dialog (not actually a wizard).
Confirmed.
*if* non-current file is to be modified, then it has to be explicitly shown to the user or chosen by the user that something like that will happen. We cannot do that behind the scenes.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss