// This is a new module or previously a library so OK
return;
}
if (rootInDB.getKey().equals(moduleKey)) {
// SONAR-4245 current subproject is actually a root project in SQ DB
throw new SonarException(
String.format("The project '%s' is already defined in SonarQube but not as a module of project '%s'. "
+ "If you really want to stop directly analysing project '%s', please first delete it from SonarQube and then relaunch the analysis of project '%s'.",
moduleKey, rootProjectKey, moduleKey, rootProjectKey));
}
if (!rootProjectKey.equals(rootInDB.getKey())) {
// SONAR-4692 current subproject is already a subproject in another project
throw new SonarException(String.format("Module \"%s\" is already part of project \"%s\"", moduleDef.getKey(), rootInDB.getKey()));
}
}
}