> > 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... >
Turns out I can't do that. That code uses the ProjectBuilder class which is not available in Maven 2.x. /Anders > > /Anders > > On Wed, Oct 29, 2014 at 3:49 PM, Igor Fedorenko <i...@ifedorenko.com> > 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= >> 5f2f3a23b62bf1cc2465c94b173700ee557edc5a >> >> [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: dev-unsubscr...@maven.apache.org >> For additional commands, e-mail: dev-h...@maven.apache.org >> >> >