ArtifactInstaller installer = embedder.lookup(ArtifactInstaller.class);
ArtifactFactory factory = embedder.lookup(ArtifactFactory.class);
Artifact main = mainArtifact.toArtifact(handlerManager,factory,parent);
if(!isPOM())
main.addMetadata(new ProjectArtifactMetadata(main,pomArtifact.getFile(parent)));
installer.install(mainArtifact.getFile(parent),main,embedder.getLocalRepository());
for (MavenArtifact aa : attachedArtifacts)
installer.install(aa.getFile(parent), aa.toArtifact(handlerManager, factory, parent), embedder.getLocalRepository());
}