You are here

Quick Start

Demonstrates how to quickly create a project using the Alfresco SDK.
This task assumes you have completed all instructions in the Installation section of this documentation.
The Alfresco SDK provides a comprehensive and convenient solution for Alfresco developers. With a single command it is possible to build and run an instance of your Alfresco project on an application server.
  1. Create a directory where you will store all your Maven projects, called maven_projects and change into it.
  2. 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): : 
    
          
  3. 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.
  4. 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.

  5. You will be prompted for the groupId. Enter the value: com.alfresco.tutorials.

    If thinking in Java terms the groupId would be the package name, typically using reverse domain name format.

  6. You will be prompted for the artifactId. Enter quick-start-project.

    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.

  7. 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 version.

    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.

  8. 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.
  9. You can build, load RAD requirements, and run your project by typing:

    
    ./run.sh                        
                            
                        
    Attention: You may first need to make the shell script executable using the command chmod +x run.sh.
  10. 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.
  11. 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.
In this task you have seen how to quickly create a sample project using the Alfresco SDK, and you have again verified that you are correctly set up to use the Alfresco SDK.

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.