How can I locate the POM which requests a missing

2019-03-25 15:10发布

问题:

When I build my project, I get these warnings:

[INFO] ------------------------------------------------------------------------
[INFO] Building XXX
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.eclipse.update:org.eclipse.update.configurator:jar:3.2.0 is missing, no dependency information available
[WARNING] The POM for org.eclipse.emf:org.eclipse.emf.ecore:jar:2.3.2 is missing, no dependency information available
[WARNING] The POM for com.ibm.icu:com.ibm.icu:jar:3.4.4 is missing, no dependency information available

In my build, I overwrite the versions of these dependencies and the build itself succeeds.

What is the fastest way to fix the warnings?

Edit: What is the fastest way to locate the POMs which contain these versions?

Note: I have 7000 POMs in my local repo.

回答1:

try the analyze tools from the dependency-plugin

especially the mvn dependency:analyze-dep-mgt



回答2:

A few things that might help:

mvn dependency:tree -Dverbose=true can spit out unused duplicates/versions. Wasn't enough in my case, however, for some reason it didn't show the offending jar's listed [?]. It also doesn't show the ommitted jar's descendants, which may or may not be useful.

ref: http://jira.codehaus.org/browse/MDEP-123

Intellij can list what it thinks are offending pom's and paths (open the pom.xml file, hover over the underlined "project":

Unfortunately none of these was enough for me, either.

Then I noticed that if you delete the offending directory from your ~/.m2/repository, it will be downloaded again and basically empty. So I think what this error message can sometimes mean is "your nexus lists a version that it doesn't actually have available for download." It appears that maven by default, if you request for instance commons-logging 1.1.1, will attempt to download the pom's for all known versions of common-logging, then, in my case, it spit out that warning but it was benign. Phew!

So in truth, none of your projects might point to the warned of bad pom (or bad version, etc.) Except nexus' metadata index.



回答3:

You could use dependency:tree to see what pom references the one you're missing