Well, I want a simple way to get a MavenProject object with artifact
dependencies which consist of folder(s) instead of a jar. I probably could
mock this, but I was thinking having a multimodule project on disk and then
build it and get hold of one of the modules (which has a dependency to one
of the other modules) would be the easiest way.

Unfortunately, maven-plugin-testing-harness v3.1.0 (where readMavenProject
was added) is too high of a Java version for the shared liv I'm working on.
:-( But I could probably borrow the code...

/Anders

On Wed, Oct 29, 2014 at 3:49 PM, Igor Fedorenko <[email protected]> wrote:

> You can also use MojoRule#readMavenProject from
> maven-plugin-testing-harness [1]. You'd have to inject any cross-module
> dependencies manually.
>
> You can also see how we do this in Tycho [2], where we delegate to
> DefaultMaven to read and resolve multimodule project.
>
> And, of course, you can just create MavenProject instance and populate
> it with relevant data.
>
> Really depends on what you actually need to do.
>
>
> [1] https://git-wip-us.apache.org/repos/asf?p=maven-plugin-
> testing.git;a=blob;f=maven-plugin-testing-harness/src/
> main/java/org/apache/maven/plugin/testing/MojoRule.java;h=
> d4d57f0ca2295a60032984d31680815364c8f805;hb=5f2f3a23b62bf1cc2465c94b173700
> ee557edc5a
>
> [2] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/
> tree/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/
> AbstractTychoMojoTestCase.java
>
> --
> Regards,
> Igor
>
>
>
> On 2014-10-29, 10:09, Anders Hammar wrote:
>
>> I'm trying to create a unit test for MSHARED-361, but I can't figure out
>> how I get hold of the MavenProject object of one of the modules in a
>> multi-module build.
>> Anyone with a pointer or a hint on where this is done in some other unit
>> test?
>>
>> /Anders
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to