How to programmatically build the effective model of a pom file?

旧时模样 提交于 2019-12-03 17:17:05

Check out this Gist https://gist.github.com/reiz/6203767. It shows a method which builds a MavenProject inside of a maven plugin. On the MavenProject you can call methods like project.getDependencies() and so on.

You could just run mvn help:effective-pom to get the pom that maven is actually using, including all default inherited and parent pom inherited attributes. I don't believe this would give you all the transitive dependencies of listed dependencies, but it should give you what you are asking for here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!