Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aether-users] how to capture information about missing dependencies

I am trying to adopt m2e dependency hierarchy calculation code [1] to
capture information about missing dependencies, which essentially
invokes RepositorySystem#collectDependencies after setting up repository
system session and collect request.

For each missing dependency I need to capture the reason the artifact is
missing and DependencyNode paths that lead to the missing dependency.

So far I've seen two kinds of behaviour but neither gives me the
information I need.

If RepositorySystem#collectDependencies returns successfully, returned
CollectResult has no exceptions, collected dependency tree includes
DependencyNode for the missing dependency as if it is present. I can see
a WARN message about the missing dependencies but no other indication
there was a problem, and nothing I can use programatically as far as I
can tell. I have a small example that demonstrates this behaviour, if
you are interested.

If RepositorySystem#collectDependencies throws
DependencyCollectionException, there is a way to find missing
dependencies, but the missing dependencies do not have corresponding
DependencyNode so I can't tell what requires them. I've only seen this
behaviour in a problem with rather complex set of dependencies and not
sure what triggers this behaviour.

Can you explain how this is expected to work? Do you have a working
example I can use as copy&paste source? Thank you in advance.


[1] http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java#n196

--
Regards,
Igor


Back to the top