Obtaining the SDK

If you are running the Enterprise network, it is likely that the SDK has been provided to you as a binary. Alternatively, you can check out the Enterprise source code and build it yourself. In the Enterprise SVN repository, specific releases are tagged. So if you wanted 2.2.0, for example, you'd check out V2.2.0-ENTERPRISE-FINAL. The Enterprise SVN repository for the Enterprise network is password-protected. Consult your Alfresco representative for the URL, port, and credentials that are needed to obtain the Enterprise source code.

Labs network users can either download the SDK as a binary from SourceForge (https://sourceforge.net/project/showfiles.php?group_id=143373&package_id=189441) or check out the Labs source code and build it. The SVN URL for the Labs source code is svn://svn.alfresco.com. In the Labs repository, nothing is tagged. You must check out HEAD.

Step-by-Step: Building Alfresco from Source

Regardless of whether you are using Enterprise or Labs, if you've decided to build from the source it is very easy to do it. At a high level, you simply check out the source and then run Ant. If you've opted to use the pre-compiled binaries, skip to the next section. Otherwise, let's use Ant to create the same ZIP/TAR file that is available on the download page. To do that, follow these steps:

  1. Check out the source from the appropriate SVN repository, as mentioned earlier.
  2. Set the TOMCAT_HOME environment variable to the root of your Apache Tomcat install directory.
  3. Navigate to the root of the source directory, then run the default Ant target:
    ant build.xml
    
  4. It will take a few minutes to build everything. When it is done, run the distribute task like this:
    ant -f continuous.xml distribute
    
  5. Again, it may take several minutes for this to run. When it is done, you should see several archives in the build|dist directory. For example, running this Ant task for Alfresco 3.0 Labs produces several archives. The subset relevant to the book includes:
    • alfresco-labs-sdk-*.tar.gz
    • alfresco-labs-sdk-*.zip
    • alfresco-labs-tomcat-*.tar.gz
    • alfresco-labs-tomcat-*.zip
    • alfresco-labs-war-*.tar.gz
    • alfresco-labs-war-*.zip
    • alfresco-labs-wcm-*.tar.gz
    • alfresco-labs-wcm-*.zip
  6. You should extract the SDK archive somewhere handy. The next step will be to import the SDK into Eclipse.