Index: continuum-1.1/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java =================================================================== --- continuum-1.1/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java (revision 7993) +++ continuum-1.1/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java (working copy) @@ -118,22 +118,41 @@ public String save() throws Exception { + boolean hasInstallation = false; + this.list(); + if ( this.installations != null ) + { + for ( Installation item : this.installations ) + { + if ( ( item.getInstallationId() != this.installation.getInstallationId() ) && ( item.getName().equals( this.installation.getName() ) ) ) + { + hasInstallation = true; + break; + } + } + } if ( InstallationService.ENVVAR_TYPE.equalsIgnoreCase( this.getInstallationType() ) ) { this.installation.setType( InstallationService.ENVVAR_TYPE ); } + this.configureUiFlags(); + if ( !hasInstallation ) + { if ( installation.getInstallationId() == 0 ) { installationService.add( installation, this.automaticProfile ); } else { - this.configureUiFlags(); installationService.update( installation ); - return "edit"; } - this.configureUiFlags(); return SUCCESS; + } + else + { + addActionError( getText( "installation.name.duplicate" ) ); + return "edit"; + } } public String delete()