Commit cccc2201 authored by maoo's avatar maoo
Browse files

prevent NPE, which occured when the AMP finalName was not complying with...

prevent NPE, which occured when the AMP finalName was not complying with ${artifactId}-${version} structure

git-svn-id: http://maven-alfresco-archetypes.googlecode.com/svn/trunk@426 04253f4f-3451-0410-a141-5562f1e59037
parent 824f744f
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -161,7 +161,10 @@ public class AmpUnArchiver extends AbstractZipUnArchiver {

		String ampName = zipFile.getName();
		ampName = FileUtils.removeExtension(FileUtils.removePath(ampName));
		ampName = ampName.substring(0, ampName.lastIndexOf('-'));
        int ampNameIndex = ampName.lastIndexOf('-');
        if (ampNameIndex > 0) {
            ampName = ampName.substring(0, ampNameIndex);
        }

		ampMapping.put("module.properties", "WEB-INF"+ fileSeparator +"classes" + fileSeparator +"alfresco" + fileSeparator +"module" + fileSeparator + moduleId + fileSeparator);
		ampMapping.put("config", "WEB-INF"+fileSeparator+"classes"+ fileSeparator);