- Create a directory where you will store all your Maven projects, called maven_projects and change into it.
To create a project using the Alfresco SDK:
mvn archetype:generate -Dfilter=org.alfresco.maven.archetype:
You will then be prompted to enter your choice of archetype (from Maven Central) to create:
Choose archetype: 1: remote -> org.alfresco.maven.archetype:alfresco-allinone-archetype (Sample multi-module project for All-in-One development on the Alfresco plaftorm. Includes modules for: Repository WAR overlay, Repository AMP, Share WAR overlay, Solr configuration, and embedded Tomcat runner) 2: remote -> org.alfresco.maven.archetype:alfresco-amp-archetype (Sample project with full support for lifecycle and rapid development of Repository AMPs (Alfresco Module Packages)) 3: remote -> org.alfresco.maven.archetype:share-amp-archetype (Share project with full support for lifecycle and rapid development of AMPs (Alfresco Module Packages)) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): :
Enter a number to select the type of project you want to create. In this case
you will enter 2, to select the alfresco-amp-archetype.
The Alfresco AMP Archetype is a sample fully-featured project to manage AMP (Alfresco Module Package) projects. This archetype can be used for Alfresco Repository AMPs.CAUTION:The order in which the archetypes are presented may change from time to time. Double check you have selected the correct archetype.
You will be prompted for the archetype version. Hit Enter to
accept the default, which will be the latest version of the archetype.
The version is the archetype version to use - the default value is the most recent version of the archetype.
You will be prompted for the groupId. Enter the value:
If thinking in Java terms the groupId would be the package name, typically using reverse domain name format.
You will be prompted for the artifactId. Enter
The artifactId can be thought of as the project name.
You can find out more about the naming conventions for these parameters in the Maven documentation.
You will be prompted for the Alfresco target version to use in your
project. Hit Enter to accept the default, which will be the latest Community
The Alfresco version by default will be the most recent version, but you can select another supported version if required.Attention: The Alfresco SDK is compatible with various Community versions and Enterprise versions of Alfresco One. Information on the Community artifacts can be found in the Alfresco wiki, and information on Alfresco One (Enterprise) artifacts can be found on the Alfresco support portal. If you would like to upgrade to the Enterprise version, please contact Alfresco through our website.
This will create a new project directory with the same name as artifactId.
Change into the new directory, quick-start-project and
then type mvn install to build your new project.
Note: Maven will ensure that all requirements are downloaded. This make take some time.
You can build, load RAD requirements, and run your project by typing:
./run.shAttention: You may first need to make the shell script executable using the command chmod +x run.sh.
You will see the Java application server (Tomcat is used by default) load and
various tests run.
Attention: If you see PermGen space errors you will need to increase the size of memory allocated to Alfresco and Tomcat by using your MAVEN_OPTS environment variable.
- You can test Alfresco is running correctly by pointing your web browser at http://localhost:8080/alfresco and logging in with a user name admin and a password of admin.