6
votes

on my development machine i'm actively working on perhaps 20 inter-dependent maven projects, most of which get published to ossrh from time to time, and i also depend on many other projects from maven central

i'd like to list the dependencies that have been installed locally as opposed to those that have been downloaded from a repository. i'm aware that mvn -U will check remote repositories for snapshot dependencies, but in many cases my versions aren't -SNAPSHOT

is there a way to tell which dependencies have been installed locally ?

1
Simple answer: No...khmarbaise
The local repository has files of name _remote.repositories in the artifact directories. They are not a public interface, but they might allow you to reverse engineer where the artifacts came from.J Fabian Meier

1 Answers

4
votes

The local repository has files of name _remote.repositories in the artifact directories. They are not a public interface, but they might allow you to reverse engineer where the artifacts came from.

@nqzero came up with the expression

mvn dependency:list -DoutputAbsoluteArtifactFilename -DoutputFile=/dev/fd/2 2>&1 1>/dev/null | grep -o "/.*/" | xargs -Ixxx grep -L "jar>central=$" xxx_remote.repositories

that actually does the trick.