如何以编程方式构建pom文件的有效模型? [英] How to programmatically build the effective model of a pom file?

查看:215
本文介绍了如何以编程方式构建pom文件的有效模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将以编程方式从pom文件创建有效模型,以获取pom模型实例中的所有继承属性。我会分析一个pom的一些属性 - 但我需要它的所有属性 - 包括。 inhertied。

I would create programmatically the effective model from a pom file to get all inherited attributes in the pom model instance. I would analyze some attributes of a pom - but I need for it all attributes - incl. inhertied.

我该怎么办?我试过Sonatype Aether,但我找不到一个例子。

What have I to do? I have tried Sonatype Aether but I did not find a example.

推荐答案

看看这个要点 https://gist.github.com/reiz/6203767 。它显示了一个在maven插件中构建MavenProject的方法。在MavenProject上,您可以调用project.getDependencies()等方法。

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.

这篇关于如何以编程方式构建pom文件的有效模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆