report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
private void validateTarget(String target, String name) {
List<String> referencedTargets = domain.getAllReferencedTargetsForApplication(name);
Application app = apps.getApplication(name);
if (app != null && !app.isLifecycleModule()){
throw new IllegalArgumentException(localStrings.getLocalString("application_withsamename_exists", "Application with same name {0} already exists, please pick a different name for the lifecycle module.", name));
}
if (referencedTargets.isEmpty()) {
if (deployment.isRegistered(name)) {
throw new IllegalArgumentException(localStrings.getLocalString("lifecycle.use.create_app_ref_2", "Lifecycle module {0} is already created in this domain. Please use create application ref to create application reference on target {1}", name, target));