DirectoryResource intermediateProjectDir = parentProject.getRoot().reify(DirectoryResource.class)
.getChildDirectory("intermediate");
Project intermediateProject = projectFactory.createProject(intermediateProjectDir, locator);
MavenFacet parentMavenFacet = parentProject.getFacet(MavenFacet.class);
List<String> modules = parentMavenFacet.getModel().getModules();
Assert.assertFalse(modules.isEmpty());
Assert.assertEquals("intermediate", modules.get(0));
intermediateProject.getFacet(MetadataFacet.class).setProjectVersion("");
intermediateProject.getFacet(PackagingFacet.class).setPackagingType("pom");
DirectoryResource subProjectDir = intermediateProject.getRoot().reify(DirectoryResource.class)
.getChildDirectory("sub");
Project subProject = projectFactory.createProject(subProjectDir, locator);
MavenFacet intermediateMavenFacet = intermediateProject.getFacet(MavenFacet.class);
List<String> intermediateModules = intermediateMavenFacet.getModel().getModules();
Assert.assertFalse(intermediateModules.isEmpty());
Assert.assertEquals("sub", intermediateModules.get(0));
String version = subProject.getFacet(MetadataFacet.class).getProjectVersion();
Assert.assertEquals(parentProject.getFacet(MetadataFacet.class).getProjectVersion(), version);