Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
Back to Developer Guide
See also: Developer Runtime Configuration
This page outlines the steps required to checkout the Alfresco Subversion Repository. This allows for the re-build of Alfresco which is useful when extending or bug fixing the Alfresco product itself.
Public read-only access to the Alfresco Subversion repository is available from the web site.
Access to the Alfresco Enterprise Branches are available for Alfresco Network Members. Contact Alfresco support for access.
Contributions are also welcome.
This is the development environment used by Alfresco engineers.
Ensure the following software is installed:
If you are using Tomcat, you will need to install two separate installations, one for Alfresco and one for the WCM/AVM virtualization server.
Create the following environment variables to point to the appropriate folder:
You should also make sure that your [ANT]/bin directory and [Subversion]/bin directory are in your PATH.
Next, open a command window and execute the following commands (windows versions used, substitute your favourite shell if appropriate).
Create the MySQL database and user required to run the application:
mysqladmin -u root create alfresco
mysql -u root -e 'grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;'
mysql -u root -e 'grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;'
Create a new directory for Alfresco:
mkdir Alfresco
cd Alfresco
Use Subversion to transfer the Alfresco source archive to your local disk, as per the instructions in the next section:
svn co http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD
Navigate to root
cd HEAD/root
All targets for building Alfresco are within build.xml. You can use ant -projecthelp to see all the available options. Here are a few of the common commands:
ant build-tomcat | builds and deploys Alfresco for Tomcat |
ant incremental-tomcat | incrementally builds and deploys Alfresco for Tomcat |
ant start-tomcat-application | executes the Tomcat start up script |
ant build-jboss | builds and deploys Alfresco for JBoss |
ant incremental-jboss | incrementally builds and deploys Alfresco for JBoss |
ant start-jboss | executes the JBoss start up script |
ant test | runs unit tests for the entire project |
Alfresco 5.0 moved to using Maven for the build
The main targets you will want are:
mvn install | builds and runs all tests for Alfresco and Share |
mvn install -DskipTests=true | quicker build, which skips all testing |
mvn test | runs unit tests for the entire project. Use mvn install if you want to both test and package Alfresco and Share |
???? | builds and deploys Alfresco for Tomcat Maven target details needed |
???? | incrementally builds and deploys Alfresco for Tomcat Maven target details needed |
???? | executes the Tomcat start up script Maven target details needed |
On Linux, you will need to install ImageMagick (http://www.imagemagick.org/script/binary-releases.php) and add a symbolic link, for example:
ln -s /usr/bin/convert /usr/bin/imconvert
Once the server has started, open a browser and go to http://localhost:8080/alfresco if you are running Tomcat or http://localhost:8080/portal if you are running JBoss and click on the Alfresco link on the left.
For deploying, the environment variable TOMCAT_HOME is used.
Although in theory you can develop Alfresco with just a text editor such as vi or Notepad. Most developers prefer a graphical GUI to work with the source code.
Most developers use Eclipse, although there are other choices that will work equally well.
The projects can be imported in the following order:
You can run the Ant targets mentioned above from within Eclipse. Firstly, you need to complete the following setup:
Create a new Simple Project (not a Java Project). I call mine Ant.
You should now see a link to build.xml in your Ant project. Double-click the file to see the contents. Eclipse also has several options to allow you to run targets in the file.
One way is to use the Outline window as it shows you all the targets in the project. Find the target you want to run and right click. Choose Run As > Ant build.
If you get errors because the environment variables, like TOMCAT_HOME, are not defined, then you can define them via Window > Preferences > Ant > Runtime > Properties and add env.TOMCAT_HOME.
If you really want to you can also debug the Ant script by placing a breakpoint in build.xml and choosing Debug As > Ant Build.
Before beginning, you will need the M2E Maven for Eclipse plugin installed
TODO Rest
Before running Alfresco you will almost certainly want to check the following common configuration options. Chances are that if you do not make the appropriate adjustments to the Tomcat startup script then it will fail to start properly and all sorts of strange things will happen.
If you are running on Windows and want to use CIFS, you also need to copy Win32Utils.dll and Win32NetBIOS.dll into the env.TOMCAT_HOME/bin. The Alfresco installer, which contains a copy of Tomcat already, has these DLLs in place but if you have been following these instructions and have installed Tomcat yourself, they will not be present.
The correct versions of the DLLs to copy can be found in SVN.
HEAD\root\projects\alfresco-jlan\jni