}
private MavenProject saveMavenProject(org.apache.maven.project.MavenProject mavenProject, MavenProject parentProjet)
throws XmlPullParserException, IOException {
MavenProjectService service = new MavenProjectService(manager);
MavenProject sonarProject;
try {
sonarProject = service.getMavenProject(mavenProject.getGroupId(), mavenProject.getArtifactId(), getBranch());
updateMavenProject(sonarProject, mavenProject, parentProjet);
manager.merge(sonarProject);
} catch (NoResultException e) {
sonarProject = new MavenProject();
sonarProject.setArtifactId(mavenProject.getArtifactId());
sonarProject.setGroupId(mavenProject.getGroupId());
sonarProject.setBranch(getBranch());
sonarProject.setEnabled(true);
updateMavenProject(sonarProject, mavenProject, parentProjet);
manager.persist(sonarProject);
}
saveModules(sonarProject, mavenProject);
return sonarProject;