Search code examples
javamavenmaven-2maven-3aether

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


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.

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


Solution

  • 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.