- Create a suitable directory in which to store all your Maven projects (if you have not already done so), such as maven_projects.
- Change into your maven_projects directory.
Run the following command:
mvn archetype:generate -Dfilter=org.alfresco.maven.archetype: Attention: As the archetypes are available via Maven Central you do not need to specify a catalog.
You will be prompted to choose an archetype:
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 3 to have the SDK create an Share project.
The detailed documentation for this archetype can be found here.
You will be prompted to choose an archetype version:
Choose org.alfresco.maven.archetype:share-amp-archetype version: 1: 2.0.0-beta-1 2: 2.0.0-beta-2 3: 2.0.0-beta-3 4: 2.0.0-beta-4 5: 2.0.0 Choose a number: 5:
Hit Enter to select the default (which is the most recent version).
- You will then be prompted to enter a value for the property groupId. Enter com.alfresco.tutorials for the groupId (this can be thought of as the package name).
- You will then be prompted to enter a value for the artifactId. Enter simple-share-project as the artifactId. This can be thought of as the project name. Note, hyphens are typically used in project names.
You will then be prompted to enter a value for the Alfresco version you wish to
test against (currently the default is 5.0.c). Hit the Enter key to accept the
A new project directory containing a number of sub-directories and support files for the AMP will be created in the directory simple-share-project.
Change into the freshly created simple-share-project
directory and browse the various files and directories to see what has been
The following directory structure has been created for you:
pom.xml // Maven project file run.sh // script to download Spring Loaded if required and run your project src/main/amp |-> module.properties |-> file-mapping.properties (optional) |-> config/ |-> web/ |-> licenses/ src/main/java //Java classes to be packaged in the AMP embedded JAR) src/main/resources //resources to the packaged in the AMP embedded JAR) src/test/java // Unit tests src/test/resources // Unit test resources src/test/properties/<env> // Environment aware alfresco-global.properties. By default <env>=local tomcat/
Look in the directory ./src/main/amp. Notice important files, such as the module.properties file, have been created for you.
At this point, before you have made any changes, you can build the project by
mvn installAttention: Maven will ensure that all requirements are downloaded. This make take some time.
The project will return with the message BUILD SUCCESS.
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.
- Once the web application has started (it may take a little while), point your browser at http://localhost:8081/share.
Log into Share using a username of admin and a password of
Attention: You will need to have already started a repository for Share to connect to. This can most conveniently be done by running up an AMP archetype project.