Re: MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Mickael Istria
On Thu, Oct 7, 2021 at 3:51 PM Oliver Drotbohm wrote: > I have a bit of a hard time constructing the state I run into when Maven > is actually run in my project: all compile time dependencies available via > getArtifacts() but the complete list of declared ones available in > dependencyArtifacts

Re: MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Mickael Istria
MavenPlugin.getMavenProjectRegistry().getProject(pomFile.getProject()).getMavenProject(monitor)

Re: MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Oliver Drotbohm
That's a bit embarrasing. That sort of does the trick but unfortunately fully resolves all artifacts. I have a bit of a hard time constructing the state I run into when Maven is actually run in my project: all compile time dependencies available via getArtifacts() but the complete list of decl

Re: MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Romain Manni-Bucau
Hi Olivier, did you try getProjectWithDependencies ? Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn

Re: MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Oliver Drotbohm
Is there an easy way to obtain a MavenProject instance from an existing POM file in a test case? I have a sample file and have tried to load that in MavenProjectTest via getProject(File). That returns an instance but the artifacts remain completely uninitialized. Anything I am missing? > On 7.

Re: MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Oliver Drotbohm
I'll give it a spin. Sorry for the apparent double post. I wasn't sure which email address I was subscribed with and the original post didn't seem to appear in my inbox, so I thought it was the wrong one. O:-) > On 7. Oct 2021, at 13:16, Mickael Istria wrote: > > Hi, > > I don't know for sure

Re: MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Mickael Istria
Hi, I don't know for sure, but your reasoning sounds good. So please try submitting a PR and we'll see if this change breaks things. Cheers,

MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Oliver Drotbohm
Hi all, in a Maven Plugin project, we need to obtain all elements of the runtime classpath during the *compile* phase. The code is currently calling `project.getRuntimeClasspathElements()`. That in turn iterates over `MavenProject.getArtifacts()` which is documented to only return elements of a

MavenProject.getRuntimeClasspathElements() not returning runtime elements

2021-10-07 Thread Oliver Drotbohm
Hi all, in a Maven Plugin project, we need to obtain all elements of the runtime classpath during the *compile* phase. The code is currently calling `project.getRuntimeClasspathElements()`. That in turn iterates over `MavenProject.getArtifacts()` which is documented to only return elements of a