2. Creating the Extension Environment

The extension environment can be built from the sources of Liferay Portal. You can opt to download the sources of the latest version from Sourceforge and unzip them to a clean directory or to obtain the latest version using subversion as explained in the previous section.

Go to the root directory of the Liferay Portal sources and create a file called release.${user.name}.properties where ${user.name} is the name of the user in your computer. Be sure to write it in the proper letter cases (even in Windows). Set the property lp.ext.dir to the directory where you would like to create the directory (make sure that it does not exist yet). If you expect to be using eclipse add also a property called lp.eclipse.project.name with the desired name of the project: For example:

lp.ext.dir=D:/Projects/liferay/portal/ext
lp.eclipse.project.name=liferay-ext

After creating the file execute the following ant targets to build the sources and create the extension directory structure:

$ ant start
$ ant build-ext

You can now go to the directory specified and see the directory structure that has been created. If you use some type of version control repository such as CVS or Subversion you can upload the directory to it. In the next steps you will be creating build products that should not be uploaded to the version control repository.

The rest of the document will be referring to the root directory where the extension environment has been download as /ext.