BY-NC-SA: fsse8info

Adding an external development server to your Eclipse-based sourcefile deployment workflow

closeThe world moved on since this content was published 8 years 11 months 5 days ago. Exercise diligent care when following any instructions and see opinions in the time they were written. If you must have an updated version, please ask kindly through the contact page.

So you are using the kick-ass Eclipse IDE? And you already have a deployment workflow based on SVN? Good. But you also want to add in an external development server that mirrors the production environment, but has your latest changes applied to them? Changes that aren’t even good enough to be committed to SVN? You’re tired of using the reluctant Export feature over and over again, just to get all the bugs ironed out? Look no further, I found what you need! (Also if you use FTP or SSH to access your server, instead of SMB)

I’ve been searching months for this. Ever since I started to use Zend Neon, and later on, Zend Studio for Eclipse 6.0 Professional, I’ve been wanting a feature that does just that. First, I’ve been researching builders. An incremental builder sounded nice, but they are all written for JAVA, and all tutorials seem to assume you can use Eclipse only for JAVA. I don’t care that you can build a Jar for .java files with one click of a button! I want my PHP files synced to my development server, so I can really test it. After a lot of different searches, and reading a whole lot, I finally found what I was looking for.

It looks like Andrei from Germany had the same issue with Eclipse, and he decided to write a plugin for it. This plugin, once installed, allows you to livesync your files to your external location, by using a special builder. By default, this builder is set to be invoked on auto-build. If you are using Eclipse for PHP development, you are probably using auto-build, or you didn’t know about this feature and should be using it. It makes life a lot easier. Added with this plugin, it removes all headaches and annoyances in publishing your files to the development server. As soon as you hit the save button in Eclipse (or hit ctrl+s), your changes are synced to the development server. Since it only syncs changed files, you must have a really, *really*, slow line to not see them immediately. Imagine this: you change a file, hit ctrl+s, hit alt+tab, hit F5, and you have the result of your work! Life can’t get much easier than this.

Installation is a breeze. Head over to the FileSync plugin for Eclipse website, download a copy and install that, or follow the written instructions to install the plugin from within Eclipse, and you’re almost there. All that is left now is to enable the builder for your project. Yes, that’s right, the builder works on a per-project basis, meaning you can have a different savepath for each project. It get’s better though: you can even have a different savepath for each seperate folder inside the project, though I doubt that much people will use this feature. You can even use UNC paths (\\server\path) for a savepath! So, to enable the plugin, just open the Project->Properties menu, and select the ‘File synchronization’ tab in the left-hand bar. Now click the checkbox to enable the builder, add the directories you want, and specify the savepath. Please note: the contents *inside* the selected folder(s) will be copied to *inside* the specified savepath (this differs from how the Export feature in Eclipse works, makes much more sense, but is a little unexpected if you used the Export feature a bit too much). Now hit the Okay button, and off you go. The builder notices it’s properties have been changed, and starts the first sync. After this is done, you are ready to continue work as usual, but have a lot less steps to worry about in the deployment workflow of sourcefiles to your development server. Just save the file, and your changes are getting synced.

Now, I did promise in the teaser to have a solution for those who were not using the SMB protocolto access their development server. Though I believe the purpose is pretty much gone if you are working on a geographicly remote server, you can find forks for a lot of different protocols on the Eclipse Deployment plugins page.


Filed Under: Tutorial

Tags: , , ,

Released: on Mar 18, 2008 under a Creative Commons Attribution-NoDerivs (CC-BY-ND) licenseCC-BY-ND

Comments (3)

Trackback URL | Comments RSS Feed

  1. Chima says:

    This could be a potential massive lifesaver for me – going to check it out now!

  2. This is something which I couldn’t find in years. Perhaps I was totally ignorant to use PHP with all my Eclipse IDE and was working with netbeans and java. Thanks for sharing the cool tip though.

  3. Anonymous says:

    Awesome! I have been Google’n this for awhile now. Thank you!