简体   繁体   中英

How to add custom folders to an exported Eclipse RCP application?

I have an eclipse application which loads a file from a folder. When I export the project and run it, the folder is only compiled binary in a jar file. But I want to edit the file after the export and so I need it in the product directory and not inside a jar. The folder is checked in the build.properties which should be the right way but it still does not work. Does anyone know where else to configure that the folder is exported as a real folder? Thanks for your help!

You can export additional files via features, and these can be contributed as folders to the root. Look for rootfolders in the eclipse PDE documentation. You have to use some special entries in the build.properties of your feature, that can not be done via PDE ui.

Having said that, it is probably a bad idea to alter those files and the product directory. This will cause issues on most multi-user and modern operating systems. The changes should be stored with the data for the plugin/OSGI bundle that produces them. Consider this method: http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getDataFile(java.lang.String )

If I understand you correctly, you want to install the plug-in in the "unpacked" form rather than in the "jar" form. This way the folders of the plug-in project in the Eclipse IDE, will also be "physical" folders when the plug-in is installed in an Eclipse framework.

This can be accomplished in a number of ways, whether the most portable currently seems to be to add the line Eclipse-BundleShape: dir to the MANIFEST.MF file. (Some tools - most notably Tycho - does not understand the alternatives.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM