You are here

Creating an AMP project in Eclipse

This task shows you how to create a new AMP project in Eclipse.
You need to have completed the installation process and also have Spring Loaded and Eclipse installed.
  1. From the Eclipse main menu select New > Maven Project.
  2. Click Next.
  3. Next to the Catalog drop down click the Configure button to select a catalog.
  4. Click Add Remote Catalog.
  5. In the Catalog File field enter
  6. In the Description field enter "Alfresco Archetypes 2.0".
  7. Click OK.
  8. Make sure the catalog you entered, "Alfresco Archetypes 2.0", is selected in the drop down list.
  9. Enter org.alfresco into the Filter field.
  10. Select alfresco-amp-archetype from the archetype list.
  11. Click Next.
  12. Enter a suitable Group Id, such as com.alfresco.tutorials.
  13. For the Artifact Id enter repo-amp-project.
  14. Click Finish.

    The project will be created and will appear in the Eclipse Package Explorer.

  15. If Eclipse indicates there are problems in the project, it is most likely because there are plugins missing. Right click the problem and select Quick Fix.
  16. Select "Discover new m2e connectors" and click Finish.

    This will display a dialog that will allow you to install the missing plugins.

  17. Install the missing plugins (if required), and restart Eclipse if asked to do so.

You now need to create a Maven run configuration.

  1. Right-click the project in the Package Explorer and select Run As > Run Configurations... .
  2. Select Maven Build.
  3. Click the New launch configuration icon.
  4. In the Name field enter a name such as "Repo AMP".
  5. You now need to select the Base Directory. Click Browse Workspace... and navigate to the root of your Repo AMP project.
  6. In the Goals field, enter integration-test.
  7. In the Profiles field enter amp-to-war.
  8. Now click the JRE tab, so you can enter some JVM options.
  9. In the VM arguments box, enter some options to allocate more memory to Alfresco, and also you will now use the path to Spring Loaded that you noted down in a previous task. The VM arguments box should contain the following (please modify to reflect your own path to Spring Loaded):

    -Xms1024m -Xmx4096m -XX:PermSize=1024m -javaagent:/Users/tbedford/Downloads/springloaded-1.2.0.RELEASE.jar -noverify                        
    Attention: You need to change the path to Spring Loaded to reflect your system.
  10. Click Apply.
  11. Click Run.
  12. Eventually you will see INFO: Starting ProtocolHandler ["http-bio-8080"], which means that Alfresco is running.
  13. Verify the Alfresco repository is running by pointing your browser at http://localhost:8080/alfresco, and then log in using the username admin and password admin.

    Attention: You can leave the repository running, as you will exploit it in the next tutorial.
You have built a repository AMP archetype and run it, entirely from Eclipse.

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.