Maven -- how to find out all library dependency on parent pom

2.6k views Asked by At

I am integrating a chaotic project, and some libraries has parent pom as SNAPSHOT, like this

<parent>
<groupId>com.xxx</groupId>
<artifactId>yyy</artifactId>
<version>2.6-SNAPSHOT</version>
</parent>

Of course, I need to fix it.

However it's really hard for me to find out which library brings in that pom, since mvn dependency:tree does not show the parent poms.

For example if A depends on yyy and yyy has a parent pom of zzz, mvn dependency:tree won't display zzz. So it's hard for me to find out which library depends on a snapshot parent pom.

Is there a maven command that can display all the parent poms of all libraries I bring in?

1

There are 1 answers

0
Abhishek Dey Das On

There is no easy way to do this because parent pom's are handled differently than maven dependencies. So dependency:tree won't work. What you can try doing though is pull each dependency and their pom, parse through and check the parent. You may also try pulling up the effective pom and use it to parse through.