3

My Eclipse plugin project includes resources (files and directories) that are project templates. The plugin has a wizard to create template projects. The plugin basically looks at the resource bundle to find the right project template and copies the resource in the user's workspace.

It works fine when tested inside Eclipse, the user can use the wizard to select a project template and the template is created in his workspace.

But when I create a product (added a product file + export the product), and test it, it works, but all the empty directories in the template are not copied in the user's workspace. When I check the plugin (jar) file, actually all the resources are there except the empty files. So, somehow, when the product is built the empty directories get ignored.

The build.properties is (the 'templates/' directory is the directory that stores all the templates, some having empty directories):

source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
           META-INF/,\
           .,\
           icons/,\
           resources/,\
           templates/,\
           OSGI-INF/,\
           intro/

Is there a way to force the jar to get all the resources (i.e. including the empty directories) ?

Loic O
  • 125
  • 2
  • 6
  • Note: It is possible using maven to force empty directories to be included in the plugin (jar) file [(url)](http://stackoverflow.com/questions/2605747/maven-how-to-include-empty-directories). I would like to do the same when exporting my product in Eclipse. Is it possible somehow ? – Loic O Oct 02 '12 at 17:45

1 Answers1

1

My kludge is to put empty files in those directories and then ignore them when generating the project from the wizard.

Chris Gerken
  • 16,221
  • 6
  • 44
  • 59
  • Yes, that would be my workaround if I cannot find the proper way to do this. Maven can do it, so I would guess that Eclipse can do it too when exporting a product. – Loic O Oct 02 '12 at 21:02
  • 1
    Since there is no better suggestion, I added ".ignore" files in the empty template directories, so when copy out of the bundle resource, the empty directories are copied over. – Loic O Oct 13 '12 at 00:54