Invariant Properties

  • rss
  • Home

How to use a Dropbox folder for eclipse projects

Bear Giles | September 8, 2010

Dropbox is a service that lets you synchronize files between systems and even a web interface.  If you’re willing and able to install the application on your work system it’s a clean way to share files between home and office.  One obvious drawback is that you need to be careful about what you put into the folder.  Resume?  check.  Pictures of the family?  check.  Pictures of the family at the nude beach?  not such a great idea.

Sounds like a great place to put your eclipse projects.  It’s a regular folder during the day but accessible from home.   It turns out there are some pretty important details.

First attempt: create an eclipse workspace under ~/Dropbox and… sproing.  Not such a great idea – eclipse keeps some logs that can’t be synced by dropbox if they’re updated simultaneously by two eclipse instances (think work and home).  It barfed so bad that I had to nuke my workspace.

Second attempt: create an eclipse workspace in the usual place and link it to an external source folder under ~/Dropbox.  You have to create a buck-naked project and add all of the natures (java, maven, etc.) to it explicitly and/or manually.  (I just updated .project and .classpath with values from an existing project.)  It works great, you can bounce between systems without incident… until you log into your old linux box with a fairly small /home partition.  100% disk usage.

It turns out that the linux dropbox client keeps some sort of database about changes.  The Windows (and other) clients probably keep a database as well. That’s not a big deal if your dropbox contains a copy of your resume and a few family pictures but is a killer if it is continuously rebuilding even a trivial spring-enabled webapp.  In a day or two I had pumped gigabytes of data into that file.  Oops.  A 500 GB partition will delay the inevitable but at some point you’ll run out of disk space.  And really piss off dropbox.com because of your heavy network usage.

Third attempt: create a dropbox-workspaces-target under my home directory (Linux) and my /Users/me folder (NOT under My Documents!).  This folder is on my local hard disk.  I then set it as my output directory in my pom.xml file:

  1. <build>
  2.   <directory>${user.home}/dropbox-workspaces-target/${project.artifactId}/target</directory>
  3.   <outputDirectory>${user.home}/dropbox-workspaces-target/${project.artifactId}/classes</outputDirectory>
  4.   <testOutputDirectory>${user.home}/dropbox-workspaces-target/${project.artifactId}/test-classes</testOutputDirectory>
  5. </build>
<build>
  <directory>${user.home}/dropbox-workspaces-target/${project.artifactId}/target</directory>
  <outputDirectory>${user.home}/dropbox-workspaces-target/${project.artifactId}/classes</outputDirectory>
  <testOutputDirectory>${user.home}/dropbox-workspaces-target/${project.artifactId}/test-classes</testOutputDirectory>
</build>

That fixes the problem for maven.  The native eclipse build still puts the files under dropbox but that’s also configurable.

Categories
java
Comments rss
Comments rss
Trackback
Trackback

« Building related maven projects in one master project Fixing "The class for the root element 'array-list' could not be found." »

3 Responses to “How to use a Dropbox folder for eclipse projects”

  1. 3dbloke says:
    February 6, 2011 at 8:09 am

    Hi. I’m a Dropbox user, on a free account with about 8GB, 60% used. I’m considering syncing some of my Eclipse projects to Dropbox, mainly as a backup, but also possibly for work on other PCs. I use Ubuntu 10.10 on my main PC and Windows7 on the other.

    I was planning to put the Eclipse project folder in Dropbox, as per your Second Attempt. It would seem a good approach. My Ubuntu set up is a single main partition, including /home, with plenty of space.

    In your description of the problem with your Second Attempt, you mention the changes log maintained by Dropbox. Is this on their website?

    I do wonder whether it’s wise to use something like Dropbox to sync a dev environment that is frequently generating new versions of build files. There would be a lot of updates. My alternative plan is to periodically (maybe manually) create a ZIP archive of my Eclipse project and copy this to Dropbox, keeping the actual project folder outside of Dropbox.

    I’d be interested in your thoughts on this and to hear how you are getting on with your own Dropbox Eclipse set up.

    –Thomas.

    Log in to Reply
    • Bear Giles says:
      February 8, 2011 at 8:50 pm

      In your home directory there is a .dropbox directory. It seems to have a copy of every variation of your files, at least for some period of time. This folder can grow to a fairly substantial size if you make a lot of frequent changes. It’s something you don’t notice on newer systems but I also have Dropbox installed on my netbook with a whole 16 GB disk (including Windows XP installation) and an older Linux system with a smaller disk and a nearly full /home partition and they were so overwhelmed that I had to uninstall Dropbox, delete the directory, and reinstall.

      The other issue is the network traffic involved. The dropbox daemon sends a copy of every changed file to the server (where you’re working) and pulls it down from the server (on all other systems where you have dropbox running) so your network usage can really add up. That’s a good use of network resources if you’re creating new content, e.g., editing source files, but your class files can be regenerated at any time from your source files – there’s no real gain in distributing them to other dropbox instances. That’s the other concern I had when putting all of my class files in a different directory.

      Log in to Reply
      • 3dbloke says:
        February 8, 2011 at 10:23 pm

        Thanks for the extra info. As my main concern is backup, I’ll probably resort to periodic ZIP archiving and put this in Dropbox or Google Docs.

        Alternatively, I’m using Git locally (I’m new to Git) with Egit in Eclipse, so I might try pushing my code to GitHub as a backup.

        Log in to Reply

Leave a Reply

Click here to cancel reply.

You must be logged in to post a comment.

Archives

  • May 2020 (1)
  • March 2019 (1)
  • August 2018 (1)
  • May 2018 (1)
  • February 2018 (1)
  • November 2017 (4)
  • January 2017 (3)
  • June 2016 (1)
  • May 2016 (1)
  • April 2016 (2)
  • March 2016 (1)
  • February 2016 (3)
  • January 2016 (6)
  • December 2015 (2)
  • November 2015 (3)
  • October 2015 (2)
  • August 2015 (4)
  • July 2015 (2)
  • June 2015 (2)
  • January 2015 (1)
  • December 2014 (6)
  • October 2014 (1)
  • September 2014 (2)
  • August 2014 (1)
  • July 2014 (1)
  • June 2014 (2)
  • May 2014 (2)
  • April 2014 (1)
  • March 2014 (1)
  • February 2014 (3)
  • January 2014 (6)
  • December 2013 (13)
  • November 2013 (6)
  • October 2013 (3)
  • September 2013 (2)
  • August 2013 (5)
  • June 2013 (1)
  • May 2013 (2)
  • March 2013 (1)
  • November 2012 (1)
  • October 2012 (3)
  • September 2012 (2)
  • May 2012 (6)
  • January 2012 (2)
  • December 2011 (12)
  • July 2011 (1)
  • June 2011 (2)
  • May 2011 (5)
  • April 2011 (6)
  • March 2011 (4)
  • February 2011 (3)
  • October 2010 (6)
  • September 2010 (8)

Recent Posts

  • 8-bit Breadboard Computer: Good Encapsulation!
  • Where are all the posts?
  • Better Ad Blocking Through Pi-Hole and Local Caching
  • The difference between APIs and SPIs
  • Hadoop: User Impersonation with Kerberos Authentication

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Pages

  • About Me
  • Notebook: Common XML Tasks
  • Notebook: Database/Webapp Security
  • Notebook: Development Tips

Syndication

Java Code Geeks

Know Your Rights

Support Bloggers' Rights
Demand Your dotRIGHTS

Security

  • Dark Reading
  • Krebs On Security Krebs On Security
  • Naked Security Naked Security
  • Schneier on Security Schneier on Security
  • TaoSecurity TaoSecurity

Politics

  • ACLU ACLU
  • EFF EFF

News

  • Ars technica Ars technica
  • Kevin Drum at Mother Jones Kevin Drum at Mother Jones
  • Raw Story Raw Story
  • Tech Dirt Tech Dirt
  • Vice Vice

Spam Blocked

53,793 spam blocked by Akismet
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox