Use Filesync Eclipse plugin for faster turn around - BloomReach Experience - Open Source CMS

Use Filesync Eclipse plugin for faster turn around

Building your web application and redeploying it every time you want to see the effects of the changes you made to your project's source code can be a time consuming process. One way to accomplish a faster development cycle is to use Jrebel. If you don't want to invest in that solution just yet, a free alternative is available to Eclipse users in the form of the Eclipse Filesync plugin. You will not have all the features you will get when using JRebel such as dynamic reloading of class files, but changing JSP files, CSS files and other static resources will work.

What is Filesync

Filesync lets you configure Eclipse so that changes made to your source files will be automatically copied to a target folder of your choice. For instance if you have JSP files or other web resources, they can be copied to your deployed web application upon saving them in Eclipse. Tomcat will pick up changes made to such files without requiring you to restart, so you will be able to test your changes immediately.

Installing Filesync

In Eclipse go to menu Help > Install New Software... Click Add...


Use location as used in the above screenshot.

Next, select to install FileSync by ticking the box:

Click Next and then Finish.

Configuring Filesync

Filesync has an accompanying Maven plugin that can generate the Filesync configuration file during a Maven build. In fact, if you set up your project using the Hippo archetype then this plugin is already configured for you. All you need to do is to run Maven after you imported your project into Eclipse. (The Maven Filesync plugin detects if you are using Eclipse by looking for a .project file in the root directory of your project, if it doesn't find one it skips the generation of the Filesync configuration file.) For instance run mvn initialize.

After you generated the Filesync configuration file using this method you must refresh the cms and site projects in Eclipse in order for Eclipse to pick up the new configuration.

To check if everything worked out as expected, open the project properties for those projects (for instance by selecting the project root folder in the project explorer and hitting Alt-Enter) and view the File synchronization settings. You should see something like this:


Note that Filesync will only work if the Eclipse Workbench is configured to do incremental builds whenever resources are saved. The setting for this is enabled by default. You can double check this by opening General > Workspace on the preferences pane. Build automatically should be enabled:


You can now edit your web application resources in ./cms/src/main/resources, ./cms/src/main/webapp, ./site/src/main/resources, and ./site/src/main/webapp and they will be automatically copied to the right locations into the cargo-deployed web applications.

If you don't want Eclipse to build automatically you can use Force File Synchronization from the context menu in the project explorer view:


Customizing Filesync configuration

Customizing the Filesync configuration is no problem. The Filesync Maven plugin is configured to skip generation of the configuration file if the configuration file is already present so your custom Filesync configuration will not be overwritten. 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?