You are here

Creating a Share project with Eclipse

This tutorial focuses on creating a Share AMP archetype project from within the Eclipse IDE.
You need to have completed the installation process and also have Spring Loaded and Eclipse installed.
This tutorial looks at creating a project based on the Alfresco Share AMP archetype.
  1. In, Eclipse, select File > Maven from the main menu.
  2. Click Next.
  3. In the New Maven Project dialog, from the Catalog menu select Alfresco Archetypes 2.0.

    This will cause a list of archetypes to be displayed in the dialog.

  4. In the Filter box enter org.alfresco.

    The Share AMP, Alfresco All-in-One, and Alfresco AMP archetypes will be listed.

  5. Select the Share AMP archetype in the filtered list, then click Next.
  6. For groupId enter com.alfresco.tutorials.
  7. For the artifactId enter share-amp-project.
  8. Click Finish.

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 "Share AMP".
  5. You now need to select the Base Directory. Click Browse Workspace... and navigate to the root of your Share 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 previously. 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 the Run button.

    Your project will now run. After a while you will see INFO: Starting ProtocolHandler ["http-bio-8081"] displayed in the Console. This means that Share is running.

  12. In order for Share to work correctly you need an Alfresco repository running (on port 8080).

    Attention: You can use the one that should still be running on port 8080 from the previous tutorial. If not, you can simply start one using the instructions in the latter part of that tutorial.
  13. Once both servers have fully started you can point your web browser at http://localhost:8081/share and log in using user name admin, password admin.

    You have created, built, and run a Share AMP archetype using 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.