You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting an NPE in DependenciesTool.loadProjectDependencies.
The issue seems to be that loadProjectDependencies assumes that all artifacts have a non-null dependency trail.
The artifacts are loaded in loadProjectArtifacts, where reactor projects are excluded as we can't expect Maven to correctly resolve artifacts for projects that may not have been built yet. The method instead replaces reactor projects with their direct dependencies in order to still get the full dependency tree. It then resolves all dependencies except reactor projects. When the dependency lists are returned, the reactor artifacts are included but not fully populated.
I'm not sure what the best fix is here. Maybe loadProjectArtifacts shouldn't return reactor projects at all? I'm not sure why we would want to return reactor projects from that method.
Caused by: java.lang.NullPointerException
at org.codehaus.mojo.license.api.DependenciesTool.loadProjectDependencies (DependenciesTool.java:243)
at org.codehaus.mojo.license.api.DefaultThirdPartyHelper.loadDependencies (DefaultThirdPartyHelper.java:156)
The text was updated successfully, but these errors were encountered:
I think the best way to fix this would be to sidestep the issue and get rid of the excludeTransitiveDependencies parameter. As far as I can tell, the idea is that if you have a project
A -> B -> C
and you exclude B, the plugin should also exclude C.
where the issue becomes what should the plugin do if you ask it to exclude A plus transitive deps? We might get a dependencyTrail that is D -> A -> C, in which case C will be excluded, but we might also get a trail D -> B -> C, in which case it isn't.
It would be better if we could filter artifacts out during dependency resolution. That way, if you exclude e.g. A, that part of the dependency tree simply won't be resolved. This would be equivalent to having excludeTransitiveDependencies always be true, but I'm not sure there's a use case for having it be false?
It would be better if we could filter artifacts out during dependency resolution.
I think that would be nice for performance reasons too.
excludeTransitiveDependencies always be true
In case there is no way to keep excludeTransitiveDependencies working in a backwards compatible way, we'd have to release that as a new major version (which I am not against).
I'm getting an NPE in DependenciesTool.loadProjectDependencies.
The issue seems to be that loadProjectDependencies assumes that all artifacts have a non-null dependency trail.
The artifacts are loaded in loadProjectArtifacts, where reactor projects are excluded as we can't expect Maven to correctly resolve artifacts for projects that may not have been built yet. The method instead replaces reactor projects with their direct dependencies in order to still get the full dependency tree. It then resolves all dependencies except reactor projects. When the dependency lists are returned, the reactor artifacts are included but not fully populated.
I'm not sure what the best fix is here. Maybe loadProjectArtifacts shouldn't return reactor projects at all? I'm not sure why we would want to return reactor projects from that method.
The text was updated successfully, but these errors were encountered: