How to Install Alfresco Module Packages (AMP) File

In this article, I'll show how to install an Alfresco Module Packages (AMP) file.

What is AMP?

 
Alfresco Module Package (AMP) contains a set of jar files, XML files and resources like JavaScript, CSS, images, etc. to extend the behaviour of Alfresco Repository or Alfresco Share application.
 
Syntax
 
java -jar alfresco-mmt.jar install <AMPFileLocation> <WARFileLocation> [options]
 
The following options are available during amp installation:
 
-preview: To verify the installation without installing the module. It lists directory locations and files that will be affected by the module installation.
 
-verbose: It will provide detailed logs that are affected / modified/ created directories / files by this installation.
 
-force: When you want to install the same module version once again.
 
-nobackup: By default, during the amp installation the source war file will be backed up. If you don't want to take the backup then use the -nobackup option. Generally it is not recommended.
 
-directory: This option will directly install the modules into an expanded directory like Alfresco or share folders.
 
Examples
 
For Alfresco Repository
 
java -jar "C:\Program Files\apache-tomcat-7.0-repository\bin\alfresco-mmt.jar" install "C:\Program Files\apache-tomcat-7.0-repository\amps\<YOUR_REPO_AMP_FILE_NAME>.amp" "C:\Program Files\apache-tomcat-7.0-repository\webapps\alfresco.war" -preview
 
java -jar "C:\Program Files\apache-tomcat-7.0-repository\bin\alfresco-mmt.jar" install "C:\Program Files\apache-tomcat-7.0-repository\amps\<YOUR_REPO_AMP_FILE_NAME>.amp" "C:\Program Files\apache-tomcat-7.0-repository\webapps\alfresco.war" - verbose
 
java -jar "C:\Program Files\apache-tomcat-7.0-repository\bin\alfresco-mmt.jar" install "C:\Program Files\apache-tomcat-7.0-repository\amps\<YOUR_REPO_AMP_FILE_NAME>.amp" "C:\Program Files\apache-tomcat-7.0-repository\webapps\alfresco.war" -verbose -force
 
For Alfresco Share
 
java -jar "C:\Program Files\apache-tomcat-7.0-share\bin\alfresco-mmt.jar" install "C:\Program Files\apache-tomcat-7.0-share\amps_share\<YOUR_SHARE_AMP_FILE_NAME>.amp" "C:\Program Files\apache-tomcat-7.0-share\webapps\share.war" -preview
 
java -jar "C:\Program Files\apache-tomcat-7.0-share\bin\alfresco-mmt.jar" install "C:\Program Files\apache-tomcat-7.0-share\amps_share\<YOUR_SHARE_AMP_FILE_NAME>.amp" "C:\Program Files\apache-tomcat-7.0-share\webapps\share.war" -verbose
 
java -jar "C:\Program Files\apache-tomcat-7.0-share\bin\alfresco-mmt.jar" install "C:\Program Files\apache-tomcat-7.0-share\amps_share\<YOUR_SHARE_AMP_FILE_NAME>.amp" "C:\Program Files\apache-tomcat-7.0-share\webapps\share.war" -verbose -force
 
Please use the following procedure to avoid unwanted issues:
  1. Backup your war file into a different location.
  2. Stop Tomcat (Repo & Share) servers.
  3. Use the preview command to verify the installation.
  4. Use the verbose command for installation.
  5. Delete the exploded directory.
  6. Start Tomcat.