How to find out which maven artifact/plugin is requesting for the download of a no longer available dependency

StackOverflow https://stackoverflow.com/questions/16667409

  •  30-05-2022
  •  | 
  •  

Question

I was compiling an "old" open sourced project, while encountered this problem:

[ERROR] Failed to execute goal on project .... Can not transfer artifact x:y:z from ...

the artifact x:y:z is not found from all repositories defined in the project pom.xml.

After looked up the effective pom.xml, I could not find any references to x:y:z.

How can I find out which artifact or plugin is requesting a missing dependency without analyze all transitive dependencies?

Was it helpful?

Solution

If you use eclipe - you can see dep tree like this: open pom.xml and tick "Dependency Hierarchy" tab.

Also you can try to use mvn dependency:tree but I am not totally sure that it will work if some of your deps are missing.

UPDATE: seems like both eclipse and dependency:tree require sucessfull artifact resolution to work whch is not your case.

In this case I guess you're left with 3 opttions:

  1. clean your cache (wipe everything under ~/.m2/repository), run your build and do occurence search (search for something like "problematic-artifact-id") on files in your ~/.m2/repository. One or couple of the artifacts should reference the problematic artifact in their pom. This should give you a hint.

  2. clean your cache and run your build with -X switch. This will put maven in verbosity mode and you should find some hints about what might reference dead dependency (point your attention on download order, what artifacts got resolved, check dependencies of resolved artifacts in their poms)

  3. dumb as hell - comment/uncomment deps in your pom and see what causes the mentioned error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top