Tracing dependencies

Answered

Is there any way to trace the source of a set of dependencies? I've got a multi-module maven project and appear to have a full set of internal org.apache.lucene jars shown under the Project tools External Libraries (also available to auto completion in the editor).

However the only resource I can find even slightly related in the modules poms is the SolrJ client, this does not include lucene. I've tried mvn tree:dependences on every pom in the project and cannot find these lucene dependencies anywhere. Also don't appear in the maven tool. This is my own project so I know nobody has manually added them to the module - I think maven support would replace manual addtions anyway.

Tried re-importing each module, invalidating caches, refreshing the dependency resolution with -U. They're still present?

Hitting Ctrl+Shift+I normally shows a contextual popup that highlights the module, if I do this on one of these lucene classes it just shows the library not the owning module?

Any ideas how to work out where these have appeared from?

3 comments
Comment actions Permalink

That doesn't seem to help, these libs don't appear in the maven tool dependencies so don't appear in the diagrams either.  We have around 200 libs so the diagram isn't that helpful. But I've checked and they're not there. The other modules in the project have no dependencies in their poms so just appear as one module node.

What I hadn't noticed about the diagram before is that test dependencies are coloured, which is nice, shame provided and runtime aren't demarked. But you can also filter the diagram by scope which is easier to read than the list of all dependencies.

Diagram also makes me wish I could include some dependencies as compile scope but include its transitives as runtime scope.

0
Comment actions Permalink

Ok think I've worked it out and there's at least one IDEA bug here, some other things that could be improved.

The libs came from one of the other modules that had no dependencies in their pom. One of these used to have solr-core, but I removed all dependencies from it some weeks ago as the module only housed the solr configset files, no code. When I removed all dependencies from the pom the Dependencies option also vanished from the maven tool display.

However it seems this edit did not remove the dependencies from the IDEA module, when I went into 'Project Structure' , Module, Dependencies tab the libs that used to be present in the pom are all still present. reimporting the pom has no effect. This is one of the potential bugs if I remove all dependencies from a pom the IDEA module was not fully kept in-sync with the change.

I removed each of these outdated dependencies from  'Project Structure' , Module, Dependencies one at a time with the [-] button, clicked OK but  the libs were still showing in the Project Tool, External Libraries. Closed the project and reopened, still there, reimported all modules one, by one, still present.

But when I went back into 'Project Structure' this time a warning appeared saying I had 63 unused libraries, I then went into Libraries and 'fix all' hit OK and the libs are finally are gone from External Libraries.

Fairly involved manual correction of IDEA project files.

0

Please sign in to leave a comment.