Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] filtering artifacts

Igor Fedorenko wrote:

Unlike maven dependency <excludes> I need suppressed dependencies to be
treated as missing and result in collection (or resolution?) failure, as
if these dependencies were not available from any enabled repository,
local or remote. I also need to report dependency trail that led to the
suppressed dependency, so I can go and fix the poms.

AFAIU, there's nothing there neatly fits your use case.

If you need to report a failure instead of silent suppression, only thing that comes to mind is using a DependencyGraphTransformer instead of the DependencySelector, walk the graph (before or after conflict resolution depending on your exact needs) and have the graph transformer throw a RepositoryException (similar to the way ConflictResolver can throw UnsolvableVersionConflictException).

I assume you will still need the VersionFilter to trim version ranges to not bail when alternative versions are still available.

Further, you might want a DependencyTraverser that blocks child dependencies (and POM retrieval for them) for blocked artifacts to optimize network access.


Benjamin


Back to the top