Re: Launching full Maven programmatically

2020-04-17 Thread Andres Almiray
Hello all, I'm building a tool interface that required reading a fully parsed, interpolated, Maven Model. It should work for all kinds of Maven projects, not just trivial ones. For example, think reading Quarkus or Helidon, which are comprised of several POM files, some of which whose parents are

Re: Launching full Maven programmatically

2020-04-17 Thread Olivier Lamy
yup but as I said it's only bug to fix but it's something which can be embedded. As I understand this is what Andres need. Most of the project can be loaded with it as long as long they are simple (i.e no core extension in .mvn etc...) maven-flatten-plugin will not really help as it's already a mav

Re: Launching full Maven programmatically

2020-04-17 Thread Matthieu BROUILLARD
Sorry but it is fully in the subject of the thread. Andres wants a way to programatically load a POM object. I guess he wants a way to load a correctly resolved POM not a partially resolved one. On Fri, Apr 17, 2020 at 11:02 AM Olivier Lamy wrote: > yes maybe some stuff to fix (feel free to send

Re: Launching full Maven programmatically

2020-04-17 Thread Olivier Lamy
yes maybe some stuff to fix (feel free to send a PR :P ) But it's not the subject of the thread :) But did you try without all the Jenkins but only the mentioned library? It's not too hard to fix (the code pointed in this thread may have the same issue) On Fri, 17 Apr 2020 at 18:49, Matthieu

Re: Launching full Maven programmatically

2020-04-17 Thread Matthieu BROUILLARD
Olivier, If the project you are pointing is what is behind "Maven Integration" in Jenkins then it does things wrong by not taking into account maven core-extensions. I just retested now: - download Jenkins.war 2.232 - launch as java -jar - default installation - add plugin "Maven integration" - i

Re: Launching full Maven programmatically

2020-04-16 Thread Olivier Lamy
Hi, That's the way to do it There is a library to ease that here https://github.com/jenkinsci/lib-jenkins-maven-embedder/tree/master cheers Olivier On Fri, 17 Apr 2020 at 13:04, Tomo Suzuki wrote: > I'm interested in that problem too. In the project below, we use > PlexusContainer to instanti

Re: Launching full Maven programmatically

2020-04-16 Thread Tomo Suzuki
I'm interested in that problem too. In the project below, we use PlexusContainer to instantiate MavenProject class from pom file: https://github.com/GoogleCloudPlatform/cloud-opensource-java/blob/master/dependencies/src/main/java/com/google/cloud/tools/opensource/dependencies/RepositoryUtility.java

Re: Launching full Maven programmatically

2020-04-16 Thread Matthieu BROUILLARD
I understood your need Andreas. Look at the plugin, if I remember well at some point it "reloads/recreate" from scratch the Model ; as you would do in your own code ; to be able to later flatten it. Regards, Matthieu On Thu, Apr 16, 2020 at 4:31 PM Andres Almiray wrote: > Thanks Matthieu, I'll

Re: Launching full Maven programmatically

2020-04-16 Thread Andres Almiray
Thanks Matthieu, I'll have a look. Though I failed to specify: the embedded API I'm looking for should work anywhere and not just within the confinement of a maven plugin where Maven components and services exist, that is, this API should work as a blackbox and in standalone mode. Cheers, Andres

Re: Launching full Maven programmatically

2020-04-16 Thread Matthieu BROUILLARD
Hi, If I remember well I think maven-flatten-plugin loads the model in a way that even core-extensions are used; you should have a look there. Matthieu

Launching full Maven programmatically

2020-04-16 Thread Andres Almiray
Hi, I'm looking for a way to launch Maven programmatically in such a way that I can get access to fully resolved Model and MavenProject instances, and not just for a single project but also for all projects that belong to a Reactor. At first I used this code try { FileReader reader = new Fil