How do I obtain a fully resolved Model of a pom file?
This is basically a rephrasing of How can i programmaticaly build the effective model of a pom file?
I\'m b
Maybe is too late for you but if it can help others in the future. So I did it like that:
@Component
private RepositorySystem repositorySystem;
@Component
private MavenProjectBuilder mavenProjectBuilder;
@Parameter(property = "project.remoteArtifactRepositories")
protected List remoteRepositories;
@Parameter(property = "localRepository")
protected ArtifactRepository localRepository;
...
Artifact pomArtifact = repositorySystem.createProjectArtifact(groupId, artifactId,version);
MavenProject project = mavenProjectBuilder.buildFromRepository(pomArtifact
, remoteRepositories, localRepository);
And that's it. It should work. If you have some special packaging (e.g. bundle...) In the target pom project make sure the plugins associated to those packaging are installed in your current project.