How to setup Eclipse IDE for ECM projects.
Alfresco Development Setup
Alfresco Development Setup
- Download form the customer portal alfresco-enterprise-tomcat-2.1.1.zip
- Make a folder {projectname} under your main drive.
- Create 2 folders under the {projectname} folder, workalfresco and deployalfresco.
- Extract the downloaded zip file in both these folders.
- Run Alfresco once before proceeding further.
- Download & Extract the SDK alfresco-enterprise-sdk-2.1.1.zip, in a temporary folder.
- Import the SDK in eclipse (Europa).
- Create a new eclipse workspace. You can call it {projectname}EWS. (EWS stands for Eclipse WorkSpace).
- Select File - Import..
- General - Existing...
- Select Root and Browse...
- Browse to the the folder where the SDK was extracted.
- Eclipse finds the projects that can be imported, the one that is required is SDKAlfrescoEmbedded. Although I typically select all, so that I can refer to source code examples.
- Make sure that 'Copy projects into WorkSpace' is selected.
- It will take some time for this activity to finish (have some coffee).
- Download the {projectname} project from Source Control, and configure it as a project in eclipse. Some teams like to share a zip file on ftp, extract it in temp folder and then import it as a project in eclipse. Just like above. If you are building from scratch then the {projectname} project will consist of the following directory structure...
- The build.xml file for this project does the work of building a jar file (for java classes) and a zip file containing both the jar above and the web resources like jsp, ftl, js, xml etc.
- In the middle of development if we need to reflect any change to the web resources only (those that do not need a restart of tomcat) then the ant target dev-refresh should be used.
- In case of a java or configuration xml change, the ant target dev-restart should be used, this will stop the running tomcat, compile and build all resources, inject the change in alfresco.war and starts tomcat
- NOTE: care should be taken for resource files that are deleted, as the build for dev does not start with a fresh war and will carry old, deleted files unless a fresh war is taken. This will not happen on production.
- So far everything is on the 'work' copy of alfresco and nothing on the deploy. Well the deploy is only for simulating production so the prod-restart ant target will do that. Make sure you have an old (the one that you started with for the first time) alfresco.war file with you.
- Here's how all the targets look like...
Post a Comment