You are here

All-in-One archetype

The All-in-One archetype of the Alfresco SDK can be used to create a comprehensive multi-module project.
This task assumes you have completed all instructions in the Installation section of this documentation.
This task shows how you can use the Alfresco SDK to build a multi-module project for Alfresco development, using the All-in-One archetype.
  1. Create a suitable directory in which to store your Maven projects (if you have not already done so), such as maven_projects.
  2. Change into your maven_projects directory.
  3. Run the following command:

                
    mvn archetype:generate -Dfilter=org.alfresco.maven.archetype: 
    
            

    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): : 
                        
    
  4. Enter 1 to have the Alfresco SDK create an Alfresco All-in-One Archetype project.

    The detailed documentation for this archetype can be found here.

  5. You will be prompted to choose an archetype version:

    
    Choose org.alfresco.maven.archetype:alfresco-allinone-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 (the latest version).

  6. 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).
  7. You will then be prompted to enter a value for the artifactId. Enter allinone-project as the artifactId.
  8. 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 (Alfresco Community). Hit the enter key to accept the default value.

    A new project directory containing a number of sub-directories and support files for the AMP will be created in the directory allinone-project.

  9. Change into the freshly created allinone-project directory and browse the various files and directories to see what has been created.

    The following directory has been created for you:

    
    run.sh
    pom.xml
       |-> repo
       |-> repo-amp
       |-> share-amp
       |-> share
       |-> solr
       |-> runner (a Tomcat embedded runner / integration test runner)
    
    

    Look in the directory ./amp/src/main/amp. Notice important files, such as the module.properties file, have been created for you.

  10. At this point, before you have made any changes, you can build the project by typing:

                            
    mvn install                        
                            
                        
    Note: Maven will ensure that all requirements are downloaded. This make take some time.

    The project will return with the message BUILD SUCCESS.

  11. 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.
  12. Direct your web browser to:

    http://localhost:8080/share

    You can log in using a user name of admin and a password of admin.

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.