Have you tried to @Inject ProjectFactory in your plugin and use it to find your external pom.xml as a new Project ? Then you could call getEffectiveDependencies() on each project object to compare dependencies.
I just tried, it works if my file is in the local repo but in the case where this pom.xml is not (yet) in the local repo then I cannot do a reference on this file.
Or should I use the remote repo to locate this file ? is this going to work with the ProjectFactory API ?
Have you tried @Inject DependencyResolver for this task ?
With that you can call resolveDependencies or resolveDependencyMetadata.
I think this is what you're looking for.
Thanks it works