I know we can download the dependency jars... but can we download the parent poms of all dependency jars?
For example Project A brings in library B as dependency, but library B has parent pom C.xml.
I want to find a command that downloads all pom.xml in Bs and C.xml.
ideally if C.xml has another parent pom D.xml, I want to download that too.
The answer by prunge shows you have to download them using dependency plugin. If you are just curious to see those poms, maven does download them to the local cached copy of the repo. Just go to .m2/repoistory and you will find them as -.pom. The file is name as .pom and is actually the pom.xml for that particular artifact
Maven dependency plugin with add parent POMs option.
mvn dependency:copy-dependencies -Dmdep.addParentPoms=true -Dmdep.copyPom=true
If that doesn't work because of Maven using an older version of the dependency plugin (you need 2.8 or later for the addParentPoms option), use the latest version explicitly:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.9:copy-dependencies -Dmdep.addParentPoms=true -Dmdep.copyPom=true
These commands download dependencies (including transitive dependencies), their POMs and all the parent POMs recursively.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With