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 declared ones available in 
dependencyArtifacts. The latter is not populated at all using 
getProjectWithDependencies().

I'm a bit surprised that I can create a MavenProject instance in all sorts of 
half-initialized, and thus invalid, states?

> On 7. Oct 2021, at 14:58, Romain Manni-Bucau <[email protected]> wrote:
> 
> Hi Olivier,
> 
> did you try getProjectWithDependencies ?
> 
> Romain Manni-Bucau
> @rmannibucau 
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Frmannibucau&amp;data=04%7C01%7Codrotbohm%40vmware.com%7Cc032104a78794cf6891208d989922cf0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637692083177239913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=mN2LzG%2BeK3vpsZXEjxUOeinUtGIOCFDK7evyFeIgrSc%3D&amp;reserved=0>
>  |  Blog
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Frmannibucau.metawerx.net%2F&amp;data=04%7C01%7Codrotbohm%40vmware.com%7Cc032104a78794cf6891208d989922cf0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637692083177239913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=mO9351%2BxTYvbyCLavVBADdly32SZGUdsRdy801f%2BVPM%3D&amp;reserved=0>
>  | Old Blog
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Frmannibucau.wordpress.com%2F&amp;data=04%7C01%7Codrotbohm%40vmware.com%7Cc032104a78794cf6891208d989922cf0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637692083177239913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=6qoresJmZFjvQXHBOfqyl685%2BNK%2F2ZUCM27D1UnACnI%3D&amp;reserved=0>
>  | Github 
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frmannibucau&amp;data=04%7C01%7Codrotbohm%40vmware.com%7Cc032104a78794cf6891208d989922cf0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637692083177239913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=II5%2Fh7jT4pcYXSHl3Fl8Lgxk%2F9vCUnynjNJS88GLzTM%3D&amp;reserved=0>
>  |
> LinkedIn 
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Frmannibucau&amp;data=04%7C01%7Codrotbohm%40vmware.com%7Cc032104a78794cf6891208d989922cf0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637692083177249862%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=hR6ZYVvPjFbi6WCxosNnBCpgXvXRVTQYMro%2FO5m7KvE%3D&amp;reserved=0>
>  | Book
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.packtpub.com%2Fapplication-development%2Fjava-ee-8-high-performance&amp;data=04%7C01%7Codrotbohm%40vmware.com%7Cc032104a78794cf6891208d989922cf0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637692083177249862%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=FLrHTLPsHw6%2BPU0SMEQncDSwKcuBLqZ9xVemtOEPkVg%3D&amp;reserved=0>
> 
> 
> Le jeu. 7 oct. 2021 à 14:05, Oliver Drotbohm <[email protected]> a
> écrit :
> 
>> 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. Oct 2021, at 13:32, Oliver Drotbohm <[email protected]> wrote:
>>> 
>>> 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 <[email protected]> wrote:
>>>> 
>>>> 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,
>> 

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to