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.
Use case: I want to know (hint in code or something) when I accidentally use transitive dependencies in my Java code in a regular maven project / it would be a good feature to be able to highlight/hint on transitive dependency usage in your own code Currently something similar is supported for maven-based NBM/Suites [1]. But this is not supported for regular maven projects. You may also consider to interpret the enforcer-rules [2][3], add some errors/warnings to the task list (like in the screenshot) and remove classes from those banned artifacts from the "go to type"/code completion result set. See discussion at mailing list [4] [1] https://netbeans.org/bugzilla/show_bug.cgi?id=201453 [2] http://maven.apache.org/enforcer/enforcer-rules/banTransitiveDependencies.html [3] http://maven.apache.org/enforcer/enforcer-rules/bannedDependencies.html [4] http://netbeans-org.1045718.n5.nabble.com/74cat-Blacklist-for-transitive-dependencies-in-regular-maven-project-td5728224.html
the enforcer rules are of no use here. with them the build will fail even when transitive dependency is not used at all in the code, it's enough to have the dependency in the resolved tree of dependencies. reworking the MavenWhiteListQueryImpl from org.netbeans.modules.maven.apisupport should not be hard however the challenge will be where to put the options to configure it. It appears to me that Hints is the right place, but the feature is not implemented via a hint api.
Yes a hint would be preferable. So i guess http://wiki.netbeans.org/wiki/images/6/6d/Whitelists.png isn't implemented as hint.
we already have some "fake" hints that store options only eg. org.netbeans.modules.maven.hints.errors.SearchClassDependencyHint another possible problem point is that current apisupport whitelist implementation precalculates transitive packages, which is likely ok in netbeans module development context but in general we could arrive at situations where a single package is in multiple artifacts.
Any chance to see this in NB 8?
not anymore. I didn't make it for 8.0, now it's only bug fixing until release
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
Still valid in 8.2 dev Product Version: NetBeans IDE Dev (Build 201607100002)